but im not quite sure where those zero-length tokens were coming from.
It would appear that if you use capture brackets in a split regex, that $n in returned regardless of whether the capture brackets are in that part of the regex that actually matched. And when they aren't, $1 gets set to the null string ('') rather than undef as you (and I) might suppose.
I've never seen this documented but that seems to be the empirical answer.
In reply to Re^3: split and capture some of the separators
by BrowserUk
in thread split and capture some of the separators
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |