title: Parsing FIX protocol in regex?
body: <p>I need to parse a logfiles that contains FIX protocol messages.</p>
  
  <p>Each line contains header information (timestamp, logging level, endpoint), followed by a FIX payload.</p>
  
  <p>I've used regex to parse the header information into named groups. E.g.:</p>
  
  <pre><code> &lt;?P&lt;datetime&gt;\d{2}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}.\d{6}) (?&lt;process_id&gt;\d{4}/\d{1,2})\s*(?P&lt;logging_level&gt;\w*)\s*(?P&lt;endpoint&gt;\w*)\s*
  </code></pre>
  
  <p>I then come to the FIX payload itself (^A is the separator between each tag) e.g:</p>
  
  <pre><code>8=FIX.4.2^A9=61^A35=A...^A11=blahblah...
  </code></pre>
  
  <p>I need to extract specific tags from this (e.g. "A" from 35=, or "blahblah" from 11=), and ignore all the other stuff - basically I need to ignore anything before "35=A", and anything after up to "11=blahblah", then ignore anything after that etc.</p>
  
  <p>I do know there a libraries that might be able to parse each and every tag (http://source.kentyde.com/fixlib/overview), however, I was hoping for a simple approach using regex here if possible, since I really only need a couple of tags.</p>
  
  <p>Is there a good way in regex to extract the tags I require?</p>
  
  <p>Cheers,
  Victor</p>