in reply to Regular expression
Assume that the above is true, and that all brackets are balanced, I'd write something like:
Alternatively, keep the warning, replace the replacement with $1 || "" and use /e to eval the replacement.{ no warnings 'uninitialized'; $line =~ s/(<[^>]*>|\$[0-9])|\$/$1/g; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular expression
by John M. Dlugosz (Monsignor) on Jun 05, 2009 at 14:54 UTC | |
by JavaFan (Canon) on Jun 05, 2009 at 15:23 UTC | |
by sandy1028 (Sexton) on Jun 08, 2009 at 04:38 UTC |