in reply to regexp help -- grab almost a whole string
sub get_regexp { if ($blah) $regexp = qr {}; elsif ($blahblah) $regexp = qr {}; }
calling program
$REGEXP = get_regexp($ip); ($circuit_id) = $if_descr =~ $REGEXP;
I want to get the correct result with one regexp without having to do any cleanup after the fact (ie removing the dot in a different step).
There must be a way to do this? If not, I will simply leave the dot in.
TDR
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regexp help -- grab almost a whole string
by kennethk (Abbot) on May 19, 2009 at 19:58 UTC | |
|
Re^2: regexp help -- grab almost a whole string
by grizzley (Chaplain) on May 20, 2009 at 05:57 UTC | |
|
Re^2: regexp help -- grab almost a whole string
by Polyglot (Chaplain) on May 20, 2009 at 03:27 UTC |