Skip to content

Instantly share code, notes, and snippets.

@jfbu
Last active September 8, 2018 20:15
Show Gist options
  • Save jfbu/451cd23300f48f06593ce288b2889d21 to your computer and use it in GitHub Desktop.
Save jfbu/451cd23300f48f06593ce288b2889d21 to your computer and use it in GitHub Desktop.
CheckWetherBrace
\catcode`@ 11
\long\def\@gobble#1{}
%\long\def\JFB@stop@firstoftwo#1#2{\z@#1}
\long\def\JFB@stop@secondoftwo#1#2{\z@#2}
\long\def\JFB@stop@thirdoffour#1#2#3#4{\z@#3}
\long\def\JFB@CheckWhetherBrace#1{%
\romannumeral
\expandafter\@gobble\expandafter
{\expandafter{\string#1.}\expandafter\JFB@stop@thirdoffour\string}%
\JFB@stop@secondoftwo
}%
\JFB@CheckWhetherBrace{cccc{aaaa}bbbb}{YES}{NO}
\JFB@CheckWhetherBrace{{aaaa}bbbb}{YES}{NO}
\bye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment