how to write regular expression for below sample in c#.net?

Posted by Divs99 under Regular Expressions on 8/3/2012 | Points: 10 | Views : 3394 | Status : [Member] | Replies : 1
my input html string looks like below

<p>XYZ<br /><br /><br />~~&nbsp;<br />25 IDIOTIC UNDER A ROCK&nbsp;<br />~~<br />LOS ANGELES,&nbsp;TX</p>

i want my output looks like this below

<p>XYZ<br /><br /><br />25 IDIOTIC UNDER A ROCK&nbsp;<br />LOS ANGELES,&nbsp;TX</p>

i tried given below REGULAR EXPRESSION code it DOESNT WORK FOR ME ..PLS HELP ME OUT..

input = System.Text.RegularExpressions.Regex.Replace(input, @"<br[ ]*/>(~~+&nbsp;)*</br[ ]*>", "<br />");

it also works for this given input string too

<p>abc<br />&nbsp;<br />nc road&nbsp;<br /><br />texxas,&nbsp;US</p>

Output i have to get in this below format

<p>abc<br />nc road&nbsp;<br />texxas,&nbsp;US</p>




Responses

Posted by: Mallesh on: 8/4/2012 [Member] Starter | Points: 25

Up
0
Down
make ur doubt clearly?
What is ur input and what are u getting output?
I can't understand ur question?



== Mallesh

Divs99, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response