in reply to repeatedly delete words expressed in alternation from end of string [regexp]
I'm a bit surprised that I didn't notice anybody offering the simple, obvious solution:
s/(\s+$RE)+$//;
(tested) Update: One was hidden in the middle of gamache's sentence.
- tye
|
---|
In Section
Seekers of Perl Wisdom