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 reply to Re: regexp - repeatedly delete words expressed in alternation from end of string (KISS)
by tye
in thread repeatedly delete words expressed in alternation from end of string [regexp]
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |