You could play around with the length $1 expression and try to limit that, but I'm not sure what corner cases would be relevant.
See perlop on how s///e works.
In reply to Re^7: How can I expand my substring?
by Corion
in thread How can I expand my substring?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |