How will the regex change if I need to match more than one digit before %var%? Just can't think of anything at the moment...
Edited: Sorry, just discovered that moving the ? solves the problem.
#$str =~ s/(\d+?)%var%(.*)/$1REPLACED$2/;</strikeout> As pointed out by Eimi Metamorphoumai $str =~ s/(\d*)%var%(.*)/$1REPLACED$2/;</strikeout>
In reply to Re^2: Regex triggering uninitialised values
by kiat
in thread Regex triggering uninitialised values
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |