Bracket Matching by yamaya

{for(;s!=$0;$0=gensub(/^([[(<{]*)(\(\)|\[\]|{}|<>)/,"\\1",1))s=$0;s?sub(/[[(<{]*/,"failed at: "):$0="yes"}NF-2?1:$3="EOL"

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

download

return to the top page