I was asking myself if it possible to replace all the Environment.NewLine in a specific div with Regex? I tried some regex by myself but I didn’t succeed in it. By the way, I know it’s not the right way to parse HTML with Regex.
This is what I had so far:
Regex.Replace(text, @"(?<=<div class=""text"">.*?)" + Environment.NewLine + "(?=.*?</div>)", "<br/>");
Thanks!
1 Answer