In a LaTeX manuscript, I need to replace many occurrences of
\emph{some string}
with some string, i.e. whatever string is inside. The string inside often may extend over several lines, and there may be other occurences of curly brackets inside it. So for example
\emph{this \it{is} a
test}
should be this
this \it{is} a
test
where alpha is any arbitrary string of characters (including newlines), you wish to replace it with
alpha
correct?
[2]
Do you know if the \emph tags are nested? If they are nested then that would require a pushdown-automata, as regular expressions alone (i.e., finite automatons) are insufficient to parse balanced-items (such as balanced parenthetical statements, for example).