<commit_before>﻿using System;
using QuickFix;
using QuickFix.Fields;
using System.Collections.Generic;

namespace csharp_fix
{
    public class MarketDataApp : QuickFix.MessageCracker, QuickFix.IApplication
    {
        Session _session = null;

        private bool ExecuteSymbolListRequest = false;
        private string FilterBySymbolId = "DERIBIT_OPT_";
        private string FilterByExchangeName = "GEMINI";

        private string[] SubscribeBySymbolRegex = new string[] 
        {
            "GEMINI_SPOT_BTC_USD", // you can use the exact match of the symbol id
            "GEMINI_SPOT_(.*)_ETH", // or you can use the regular expression syntax to get eg. all spot symbols to ETH from GEMINI
            "GEMINI_SPOT_(BCH|LTC)_USD" // second example of the regex, the BCH/USD & LTC/USD
        };

        #region IApplication interface overrides

        public void OnCreate(SessionID sessionID)
        {
            _session = Session.LookupSession(sessionID);
        }

        public void OnLogon(SessionID sessionID)
        {
            Console.WriteLine("Logon - " + sessionID.ToString());

            if (ExecuteSymbolListRequest)
            {
                // get all the symbols
                SecurityListRequestAll();

                // get symbols only by the symbol prefix
                if (!string.IsNullOrWhiteSpace(FilterBySymbolId))
                {
                    SecurityListRequestFilteredBySymbolIdPrefix(FilterBySymbolId);
                }<commit_msg>converted to regex<commit_after>﻿using System;
using QuickFix;
using QuickFix.Fields;
using System.Collections.Generic;

namespace csharp_fix
{
    public class MarketDataApp : QuickFix.MessageCracker, QuickFix.IApplication
    {
        Session _session = null;

        private bool ExecuteSymbolListRequest = false;
        private string FilterBySymbolId = "DERIBIT_OPT_(.*)";
        private string FilterByExchangeName = "GEMINI";

        private string[] SubscribeBySymbolRegex = new string[] 
        {
            "GEMINI_SPOT_BTC_USD", // you can use the exact match of the symbol id
            "GEMINI_SPOT_(.*)_ETH", // or you can use the regular expression syntax to get eg. all spot symbols to ETH from GEMINI
            "GEMINI_SPOT_(BCH|LTC)_USD" // second example of the regex, the BCH/USD & LTC/USD
        };

        #region IApplication interface overrides

        public void OnCreate(SessionID sessionID)
        {
            _session = Session.LookupSession(sessionID);
        }

        public void OnLogon(SessionID sessionID)
        {
            Console.WriteLine("Logon - " + sessionID.ToString());

            if (ExecuteSymbolListRequest)
            {
                // get all the symbols
                SecurityListRequestAll();

                // get symbols only by the symbol prefix
                if (!string.IsNullOrWhiteSpace(FilterBySymbolId))
                {
                    SecurityListRequestFilteredBySymbolIdPrefix(FilterBySymbolId);
                }
{'fraction_non_alphanumeric': 0.07282356835484939, 'fraction_numerical': 0.0, 'mean_word_length': 2.154488517745303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2110370', 'n_tokens_mistral': 812, 'n_tokens_neox': 776, 'n_words': 216}