Search code examples
c++pattern-matchingstring-matchingfix-protocol

Filtering Messages by fields


I want to find messages which are matched with a user define pattern using C++ Code. The sample message is

8=FIX.4.4|9=70|35=A|34=1|49=SAM|52=20170124-02:55:47|56=SAM|98=0|108=300|141=Y|10=236|

This is FIX message.

I want to find out is a message is matched with user defined filter or not?

A sample filter is

(9=70 OR 35=A) AND 49=SAM

Is there any library for matching? I would have to say that I can change the format of filter, but I need to support AND, OR , = , ()


Solution

  • Sam!

    I believe that you can use standard cpp regular expression library to solve this problem that way. And here is small guidance how to build your AND/OR conditions.