That code is broken.
You can't declare $re on the same line as you're using it. It won't even compile (under strict vars).
There's a I reason I used a package variable instead of a lexical. It'll bite you if you interpolate into $re. Best to always use a package variable to avoid the problem entirely.
While not a bug per say, the s modifiers on both regeps are useless because you don't use ..
our $re local $re = qr{\[(?:(?>[^\[\]]+)|(??{$re}))*\]}; for (;;) { last unless $tempstr =~ s/(\[\w+?\s*=\s*($re|\n|[^\[\] +])+\])/assign($1)/gie; }
It's unfortunate that you modify things without knowing why they were done in the first place.
In reply to Re^3: How to find the outermost pair of square brackets with a regex?
by ikegami
in thread How to find the outermost pair of square brackets with a regex?
by lokiloki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |