how to write regex in this case if there are &nbsp; between multiple <br/> using c#.net?

Posted by Divs99 under C# on 8/1/2012 | Points: 10 | Views : 1887 | Status : [Member] | Replies : 0
how to write regex to Replace &nbsp; between multiple <br/> using C#.net?

by using below regex iam able to replace multiple <br> into single <br> using C#.net......


my problem is iam unable to replace if there are space between the <br> an the line-breaks...

for example:

<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />----how to write regex in this case there are space between the <br> an the line-breaks...


below regex works only if dont have space between breaks...

Regex.Replace(sampleText, @"[(<br( /|)>|<br( /|)>\n)]{2,}", "<br />");

how to write regex in this case there are space between the <br> an the line-breaks...




Responses

(No response found.)

Login to post response