Bracket Matching by kimiyuki

#!perl -pl
$e='[])}>]';s/.$e// while/.($e)/&chr(2-(')'eq$1)+ord$&)eq$1;$_=$_?'failed at: '.(/$e/?$&.$':EOL):yes

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page