|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Substitute _last_ occurence in string?by Wookie (Beadle) |
| on Jul 25, 2001 at 14:46 UTC ( [id://99696]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
You can try to use the fact that '*' is greedy: 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. So in this case - it should find the last one. game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||