Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madblobfish/4b9883e3d7593f4f90b8fe0f3a1e1dc0 to your computer and use it in GitHub Desktop.
Save madblobfish/4b9883e3d7593f4f90b8fe0f3a1e1dc0 to your computer and use it in GitHub Desktop.
Recursive RegExp to find empty sectionings in latex
\\(chapter|(sub)*section)(\{([^{}]*(?3)?[^{}]*)*\})\s*\\(chapter|(sub)*section)
Matching Examples:
1
\section{yoooo{} \textbf{asd}}
\section
2
\section{{y}{y}{y}{y{y}y}y}\section
Not Matching:
1
\section{yoooo{} \textbf{asd}}
some text
\section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment