$ 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
In reply to Re: First word
by haoess
in thread First word
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |