in reply to Re: Substitute _last_ occurence in string?
in thread Substitute _last_ occurence in string?
This can be expressed a little bit simpler: $string=~s/(.*) two/$1/; The /g modifier is not necessary - there will be only one match. And you don't want to change anything after the match so you don't have to capture and replace it.
-- Hofmator
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Substitute _last_ occurence in string?
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 |