http://qs321.pair.com?node_id=682585


in reply to First word

$ perl -wle 'print shift =~ /^(\w+)\b/' "That's my sentence." That

As you can see, \w matches a word character, and \b marks the end of the first word (since we're matching the beginning aka ^ of the string).

More information at perlre.

-- Frank