I've never encountered such a problem, but could you use pos, capture the pattern, and use length on $1 to calculate what you need? You'd have to use the /g modifier, but I think it might work.
In reply to Re: nested pattern matching
by chromatic
in thread nested pattern matching
by vinforget
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |