Bracket Matching by nn

{for($(FS=f=i=j=_)=$0;!f&&$++j;x%2?S[++i]=x+1:f=S[i--]-x)x=index("()[]{}<>",$j)}$0=i+f?"failed at: "($j?substr($0,j):"EOL"):"yes"

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

download

return top