laziness, impatience, and hubris | |
PerlMonks |
Re: Reg Expby psini (Deacon) |
on May 26, 2008 at 09:37 UTC ( [id://688504]=note: print w/replies, xml ) | Need Help?? |
You could use split, that splits a string into an array using a regex to determine the split position(s), as follow: @result=split(/\s+\(|\)\s+/, $string); This should split the string at any open parenthesis preceded by one or more spaces, and at any closed parenthesis followed by one or more spaces. Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.
In Section
Seekers of Perl Wisdom
|
|