Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: regex needed

by OM_Zen (Scribe)
on Jan 30, 2003 at 20:52 UTC ( #231435=note: print w/ replies, xml ) Need Help??

in reply to regex needed

Hi ,

#1 [] [] 87 #000:00:00.0000.000.000 +0 #+6/07/2000 04:39:00 PM SNMP: Get # Guess you have to ( pattern ) to store and use it with $1 +,$2,$3 , in your code you match it but you do not store it and hence +print the line by itself if ($_ =~ /(\[.*\])\s+(\[.*\]).*(SNMP: Get$)/){ print "[$1] [$2] [$3]\n"; }

# $_ =~ s/(\[.*\]) #match within first [ #charachters inside it ] # \s+ #match a space after this # (\[.*\]).* #match again for the second [ #charachters inside it ] # (SNMP: Get$)/; #match the SNMP part of # the string # print "$1 $2 $3\n";

Comment on Re: regex needed
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2015-11-28 17:57 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 (743 votes), past polls