in reply to minimal matching regex

Update: Disregard. Misread the OP. You say you do want only 'xyzxyzxyz'. Duh.

You say what you don't want, 'xyzxyzxyz', but don't say what you do want. I'm going to assume it's the phrase 'Prod Cache Broker'. Here's one approach. The definition of the  $word regex can be tuned to match the data you're handling.

c:\@Work\Perl\monks>perl -wMstrict -le "my $str = 'xyzxyzxyz - Prod Cache Broker - 16100'; ;; my $word = qr{ [[:alpha:]]+ }xms; ;; my ($phrase) = $str =~ m{ - \s+ ($word (?: \s+ $word)*) }xms; print qq{'$phrase'}; " 'Prod Cache Broker'


Give a man a fish:  <%-(-(-(-<