in reply to need regular expression
$var1=~s/\.xml$/.jpg/;
This would substitute .xml at the end of a string with .jpg. '$' matches at end of string, '.' has to be escaped with '\' since it would have special meaning otherwise.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: need regular expression
by techtween (Novice) on Jul 13, 2011 at 12:21 UTC | |
by MidLifeXis (Monsignor) on Jul 13, 2011 at 12:56 UTC |