$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.
In reply to Re: need regular expression
by jethro
in thread need regular expression
by techtween
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |