Following up on the first two replies, if the code seems to work well enough on a small set if input data, then the problem is probably with the regexes being to complicated. For one thing, you're capturing up to 8 strings with parens, but you never use more than three of the captures. But the real problem is the number of greedy matches (+ or * instead of using specific numbers or ranges or non-greedy +? and *? wherever possible).

It also looks like you might not understand some basic details about regex syntax. When you say ([0-9]+.[0-9]+) are you forgetting that "." matches any character (not just a literal period)? Your use of vertical bars in ([F|.|R]) probably doesn't mean exactly what you intend.

There's bound to be an easier way to parse each line; maybe start by splitting on whitespace into an array, then test the particular elements of the array that matter (ignore the rest), rather than running one or more heavy regexes on the full content of each line.

It might help if you post a small amount of relevant sample data.


In reply to Re: Why this code not working with pcap files? by graff
in thread Why this code not working with pcap files? by lepetal

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.