That is, if you split on a bracketed group, capture it. If you don't have a bracketed group, split on nothing. Then filter out where the capture didn't match.@array = grep defined, split /(\[.*?\])|/;
In reply to Re^2: Complex Splitting
by Roy Johnson
in thread Complex Splitting
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |