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 reply to Re: Reg Exp
by psini
in thread Reg Exp
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |