# Find the *first* three letter word in the string my $str = "one two three four five six seven eight nine ten"; my @x = $str =~ m/b(w{3})b/; # ("one")