use warnings; use strict; my $RE = qr! \b ( SA | NV | LTD | CO | LLC ) \b !ix ; while (<DATA>) { s/$RE//g; print; } __DATA__ Bobs Warehouse SA LTD Jims Fine Wines CO LLC
Outputs:
Bobs Warehouse Jims Fine Wines
In reply to Re: regexp - repeatedly delete words expressed in alternation from end of string
by toolic
in thread repeatedly delete words expressed in alternation from end of string [regexp]
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |