Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: (cLive ;-)(Golf) Analyzing Time From tcpdump Output

by chipmunk (Parson)
on Feb 05, 2002 at 16:00 UTC ( #143472=note: print w/ replies, xml ) Need Help??

in reply to (cLive ;-)(Golf) Analyzing Time From tcpdump Output
in thread (Golf) Analyzing Time From tcpdump Output

Yes, I am sure. I did run it, and it output the wrong answer:

-49.994325 -
It doesn't matter that \d+ is greedy, because .* is greedy and gets to go first. The .* only backtracks far enough to allow the \d+ to match. \d+ can match a single digit, so .* only gives up a single digit. But to get the correct answer, \d+ has to match two digits before the decimal point, not one.

On the other hand, it's okay if $2 only contains one digit before the decimal point, if $1 also contains a single digit before the decimal point: perl -lp0e'/(\d\.\d+).*(\d\.\d+)/s;$_=$2-$1'

Comment on Re: (cLive ;-)(Golf) Analyzing Time From tcpdump Output
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2015-11-30 04:44 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (757 votes), past polls