Hi Monks,
I'm new to Perl and trying to figure out how to only replace matches after the initial match using regex. For example, I would like to replace any matches of bar with foo after finding the first bar.
Input foofoo
Output foobar
I have tried what I believe is look ahead assertion
$s = s/bar(?=bar)/foo/;
However it seems to get rid of everything and print an empty string.
In reply to Regex match and replace by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |