What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 6165 |  Welcome, Guest!   Register  Login
 Home > Forums > Regular Expression > how to write regular expression for below sample in c#.net? ...
Divs99

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

Replies: 1 | Posted by: Divs99 on 8/3/2012 | Category: Regular Expression Forums | Views: 700 | Status: [Member] | Points: 10  


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>


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Mallesh
Mallesh  
Posted on: 8/4/2012 6:14:38 AM
Level: Starter | Status: [Member] | Points: 25

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. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/26/2013 3:37:13 AM