in reply to Re: Perl Parsing Power
in thread Perl Parsing Power
Admittedly, it is a basic example, although powerful in its implications.
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))*+})/;'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl Parsing Power
by BrowserUk (Patriarch) on Sep 24, 2012 at 10:58 UTC | |
by protist (Monk) on Sep 24, 2012 at 11:16 UTC |
In Section
Meditations