I am facing an issue with replacing the given string
\section{Welcome to $\mathbb{R}^n$}
Some content
with
<h1>Welcome to $\mathbb{R}^n$</h1>
Some content
The challenge lies in having opening {
and }
between the curly brackets themselves. I attempted using the following code snippet in JavaScript:
strOutput = strOutput.replace(/\\section\*\s*\{([^}]*)\}/g, "<h1>$1</h1>");
However, it didn't work as expected. How should I proceed to solve this problem?