Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Regex match for Any number of words?by haj (Vicar) |
on Jan 16, 2022 at 11:43 UTC ( [id://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
|
|