Limo has asked for the wisdom of the Perl Monks concerning the following question:
I want to match all lines, EXCEPT those containing, "Clock", "Switch", "Power", " Processor". Here's the regex:SLOT 0 (RP/LC 0 ): Route Processor SLOT 2 (RP/LC 2 ): 1 Port Packet Over SONET OC-12c/STM-4c Single Mode SLOT 3 (RP/LC 3 ): 1 Port Packet Over SONET OC-12c/STM-4c Single Mode SLOT 4 (RP/LC 4 ): 1 Port Packet Over SONET OC-12c/STM-4c Single Mode SLOT 7 (RP/LC 7 ): 1 Port Packet Over SONET OC-12c/STM-4c Single Mode SLOT 16 (CSC 0 ): Clock Scheduler Card(8) SLOT 17 (CSC 1 ): Clock Scheduler Card(8) SLOT 18 (SFC 0 ): Switch Fabric Card(8) SLOT 19 (SFC 1 ): Switch Fabric Card(8) SLOT 20 (SFC 2 ): Switch Fabric Card(8) SLOT 24 (PS A1 ): DC Power Supply(8) SLOT 26 (PS B1 ): DC Power Supply(8)
What's going on, here??? I've tried [^...]; didn't work. Along with every other way, but the right way, apparently.if ($rtr_diag =~ m/^(SLOT.*$)/ && ! /(Processor.*$)/|/(Switch.*$)/|/(Power.*$)/|/(Clock.*$)/ ) { do stuff}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jcwren) RE: THIS not THAT
by jcwren (Prior) on Oct 03, 2000 at 07:09 UTC | |
|
Re: THIS not THAT
by chromatic (Archbishop) on Oct 03, 2000 at 08:28 UTC | |
by Limo (Scribe) on Oct 03, 2000 at 08:33 UTC | |
by merlyn (Sage) on Oct 03, 2000 at 09:07 UTC | |
by extremely (Priest) on Oct 04, 2000 at 01:41 UTC |