Another way.
$re = qr[ ( the(?{$rep='The'}) | quick(?{$rep='Quick'}) | brown(?{$rep='Brown'}) | fox(?{$rep='Fox'}) ) ]x; $s = 'the quick brown fox'; $s =~ s[$re][$rep]g; print $s; The Quick Brown Fox
In reply to Re: Regular expression question
by BrowserUk
in thread Regular expression question
by TASdvlper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |