Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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 [111.123.164.80] [123.126.126.126] 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";


Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://231435]
help
Chatterbox?
[LanX]: unusual that "Pimp my Bride" never made it into TV (?)
LanX sighs ... no idea stupid enough
[choroba]: "Smack My Bitch Up" did, though
[Eily]: that's the internet for you LanX
[Eily]: and I'm pretty sure there's a rule somewhere that states that the stupider the idea, the more likely it is to already have been done
zentara is thinking of moving to Mars to esacpe it all

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (14)
As of 2017-03-27 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.