Hmmmm
so i have found one thing which is strange, when i run the code
#!/usr/bin/perl use strict; use warnings; my @tags = qw( 8= 9= 35= ); my $reg_ex = join( '|', @tags ); open(FH, "test.log")||die("Unable to open log file: $! \n"); while(<FH>) { print "$_\n" if ( $_ =~ /$reg_ex/s ); }
and test.log being the above, i found that the that entry is one line, so the output i get it
$ perl t.pl 2005/11/18 00:06:49:875: FIXPump: Received data on connection {OBMSCNX +} [8=FIX.4.29=040435=849=EXLINK256=DB_ORDER50=DESRISKGATEWAY57=DCN323 +0134=4045052=20051118-05:06:491=ATOP116=0.0000000011=DES:fud630_20051 +11814=15.000017=0131730433520=031=138.0800000032=15.000037=1317260622 +38=15.000039=254=155=ContractNum60=20051118-05:06:49150=2151=0.000019 +8=13173047101317260622109=DCN3230163=0167=FUT200=200512207=TSE40=244= +138.080000005113=06556=20051117-23:06:4610=230]
What i really want to do is be able to pull out each of the tage, so break up the line and say look for 35= and give me whatever is after that, and then carry on and say find 109= and and give me everything after that. The problem i see is that there is no break between them.
so 8=FIX.4.29=040435=8 should read
8=FIX.4.2
9=0404
35=8


In reply to Re^2: Message regex by minixman
in thread Message regex by minixman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.