Yeah, "last if" is a good call, I wasn't thinking. The OP wasn't clear exactly how they wanted the results back (string or array of words), so I choose string. Nice convert to array though.
As far as [^\s] versus \S, force of habit. If my laziness virtue would kick in like its supposed to, I'd have switched to \S by now and saved some keystrokes :)
-jbWareIn reply to Re^3: Counting words
by jbware
in thread Counting words
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |