Capturing parenthesis are your problem, and this is documented in split. One solution, as mentioned previously, is to use a character set ([ square brackets ]) instead of parenthesis. Using a character set would eliminate the need for alternation, and hense, eliminate the need for constraining parenthesis.
That's not the only solution, however. If your alternation is over entities that span more than a single character, a character set wouldn't help. In that case you would still need something to constrain the alternation. If you wish for grouping without capturing, use (?: ..... ) instead of ( ..... ). This regular expression syntax is documented in perlre and perlretut. Basically it does everything parenthesis do, minus the capturing.
Dave
In reply to Re: Why do I get regexp chars in split?
by davido
in thread Why do I get regexp chars in split?
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |