in reply to Substitute _last_ occurence in string?
When the first '.*' matches - it should go to the end of the line - and then work right to left to match the next part of the regex.$string=~s/(.*) two(.*)/$1$2/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Substitute _last_ occurence in string?
by Hofmator (Curate) on Jul 25, 2001 at 19:05 UTC | |
by dragonchild (Archbishop) on Jul 25, 2001 at 19:11 UTC | |
by Hofmator (Curate) on Jul 25, 2001 at 19:22 UTC | |
by carlitos (Acolyte) on Jul 26, 2001 at 14:39 UTC |