I want the space between the span tags to be replaced by
<span style="font-size:11;color:black"> </span>
I wrote this regex:
Regex.Replace(xml, @"<span[^>]*?>\s*</span>", (match) => match.Value.Replace(" ", " "), RegexOptions.IgnoreCase);
But it give me this output:
<span style="font-size:11;color:black"> </span>
It also places the after the span.
You could use
as your regex.
Be aware, that parsing HTML with regular expressions is frowned upon and will break horribly when encountering (among others) HTML Comments and JavaScript.