Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Problem with alternating regex?

by jwkrahn (Monsignor)
on Sep 11, 2012 at 03:38 UTC ( #992912=note: print w/replies, xml ) Need Help??


in reply to Problem with alternating regex?

$ perl -le' for my $line ( q/set zone "VLAN" vrouter "trust-vr"/, q/set zone id 10 +0 "Internet_Only"/ ) { if ( $line =~ /^set\szone\s(?:"([^"]*)"|id\s\d+\s"([^"]*)")/ ) { my $zone = $^N; print $zone; } } ' VLAN Internet_Only

Or:

$ perl -le' for my $line ( q/set zone "VLAN" vrouter "trust-vr"/, q/set zone id 10 +0 "Internet_Only"/ ) { if ( $line =~ /^set\szone\s(?:id\s\d+\s|)"([^"]*)"/ ) { my $zone = $1; print $zone; } } ' VLAN Internet_Only

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992912]
help
Chatterbox?
[LanX]: commander in chief whatever
Discipulus fears to ears this in German..
[LanX]: missing for month
[LanX]: D : Oberbefehlshaber
[GotToBTru]: yeah, thats the story I remember. some card the President is supposed to carry around at all times
[GotToBTru]: I suppose the actual details about what is necessary to actually do something is kept fuzzy deliberately
[LanX]: the interview was with the guy who designed the process
[LanX]: in the 70s

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-01-20 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.