in reply to Re: Regex triggering uninitialised values
in thread Regex triggering uninitialised values
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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex triggering uninitialised values
by Eimi Metamorphoumai (Deacon) on Nov 19, 2004 at 18:01 UTC | |
by kiat (Vicar) on Nov 19, 2004 at 18:06 UTC |