my $txt = '-UK 123 123-UK 123-UK 123-UK abc-oops!'; print "|$1|\n" while $txt =~ /((?:\d+-UK\s))/g;