You have made a slight mistake with your look-ahead syntax.
| (?=pattern) | Positive look-ahead | match is followed by pattern |
| (?!pattern) | Negative look-ahead | match is not followed by pattern |
| (?<=pattern) | Positive look-behind | match is preceeded by pattern |
| (?<!pattern) | Negative look-behind | match is not preceeded by pattern |
Note that for look-behind assertions the pattern can not be of variable width.
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^2: Replacing exactly the found instance in REGEX
by johngg
in thread Replacing exactly the found instance in REGEX
by inquis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |