I have string like
[any characters]{$\prime$}[any characters]$[any characters]{$\prime$}[any characters]$[any characters]
I want to replace the $\prime$ that is inside $ “The second one” to be replaced by \prime
so the output from replace is
[any characters]{$\prime$}[any characters]$[any characters]{\prime}[any characters]$[any characters]
How can I do that using Reqex.Replace
and here is the code I use
trannsformContent = Regex.Replace(trannsformContent, @"(\$)(?<cont>.*?)(\$)\\prime(\$)(?<cont1>.*?)(\$)", @"${cont}\prime{cont1}$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
I found the solution :