http://www.perlmonks.org?node_id=649242


in reply to repeatedly delete words expressed in alternation from end of string [regexp]

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