Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Why this code not working with pcap files?

by graff (Chancellor)
on Nov 03, 2012 at 04:23 UTC ( #1002072=note: print w/ replies, xml ) Need Help??


in reply to Why this code not working with pcap files?

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.


Comment on Re: Why this code not working with pcap files?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002072]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-08-29 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls