perl -le "$pat=qr/ \w\w /;$_='ABCD EF GHI JKL MN OPQRST UV';m/($pat).*?$/ or die;print $1" #### m/.*(PATTERN).*?$/