Skip to content

Instantly share code, notes, and snippets.

Created August 17, 2016 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1e15601f9771abef580d5c2ed9c2bf14 to your computer and use it in GitHub Desktop.
Save anonymous/1e15601f9771abef580d5c2ed9c2bf14 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