my $WordRegex = qr/\b \w+ \b/; # Oops, missing the /x modifier! if ($text =~ m/^($WordRegex)/x) { print "found word at start of text: $1\n"; } ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl