to make the parens non-capturingmy @array = split(/,(\s+|)/, $string); # change to my @array = split(/,(?:\s+|)/, $string);
Update Zaxo's is much better in practice... but if you ever do need grouping, (?: ) will not capture like ( ) will
- Ant
- Some of my best work - Fish Dinner
In reply to Re: split strangeness
by suaveant
in thread split strangeness
by rob_au
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |