![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: Substitute _last_ occurence in string?by Wookie (Beadle) |
on Jul 25, 2001 at 18:46 UTC ( [id://99696]=note: print w/replies, xml ) | Need Help?? |
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
|
|