![]() |
|
There's more than one way to do things | |
PerlMonks |
Re: Regex match for Any number of words?by haj (Priest) |
on Jan 16, 2022 at 11:43 UTC ( #11140502=note: print w/replies, xml ) | Need Help?? |
There are several ways to do this. A rather short one is:
So I'm splitting the text whenever I found one or more characters which are not words. I don't know whether eliminating empty strings at the beginning and the end of the list is relevant, so I'm leaving this as an exercise to the reader (hint: grep $_,@list might not do what you want if you consider numbers as words).
In Section
Seekers of Perl Wisdom
|
|