It tests for proper nesting of brackets, anchored to the beginning of the line. You can try it out:print "good string\n" if $_~~ /^({(?:[^{}]++|(?1))*+})/;
perl -ne 'print "good string\n" if $_~~ /^({(?:[^{}]++|(?1))*+})/;'
In reply to Re^2: Perl Parsing Power
by protist
in thread Perl Parsing Power
by protist
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |