Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Matching Wordsby Zaxo (Archbishop) |
on May 23, 2002 at 06:28 UTC ( [id://168679]=note: print w/replies, xml ) | Need Help?? |
How about this? The pop and shift are needed because split leaves empty elements at the ends if nonword characters are there. A couple of comments on your code. I think you mean \W*$/ at the right of your regex. Also, you can use a (?:\W+\w*\W*)+ to get grouping without capture. Update: I sure like MeowChow's array slice in print:
Update 2: A palpable hit, ++tadman. Corrected. After Compline,
In Section
Seekers of Perl Wisdom
|
|