in reply to Re: Regex: Matching around a word(s)in thread Regex: Matching around a word(s)
my @text = split /\s+/, $text; my @results; for (@text){ push @results, $1 if m/\b($expr)\b/; } [download]