in reply to look-behind regex
which is pretty straight forward if you realize how regular expressions are matched./^(?:(?!pattern).)*$/s;
For your problem, this leads to:
And if Japhy's new \K assertions gets accepted, you will be able to write it as:s/^((?:(?!toto).)*?)foo/${1}bar/s;
Abigails/^((?:(?!toto).)*?)\Kfoo/bar/s;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: look-behind regex
by japhy (Canon) on Jul 24, 2002 at 12:55 UTC | |
by Anonymous Monk on Jul 25, 2002 at 02:20 UTC |