I need to extract all indices from my latex files. But some indices may look like this
\index{*3*sqrt*uppersqrt{\hspace{-2.5pt}$\uppersqrt{\;\;\;}$(upper square root)}}
So i need to somehow count in regex number of currently opened curly brackets. I don't know how to handle such a case.
Also, if index contain /
then i don't need such index.
Example:
Anything before. \index{{}{}}\index{Hi}\anothertag{something}
\index{}{}
\index{/}
expected result is
\index{{}{}}
\index{Hi}
\index{}