Regarding regular expressions

Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Regarding regular expressions

 
0
  #1
Sep 29th, 2007
hi all,

I am working in a windows application. i have a text say for eg,

<img src="http://static.ibnlive.com/pix/sitepix/06_2007/kumaraswamy_cm90.jpg"
alt="BACKTRACKING? Kumaraswamy says he never said he would step down on October 3."
title="BACKTRACKING? Kumaraswamy says he never said he would step down on October 3"
border="0" width="90" height="62" align="left" hspace="5&"/>
Kumaraswamy has denied reports that he would step down on October 3

i need to remove the img tag entirely and display only this part.
Kumaraswamy has denied reports that he would step down on October 3

i tried using the following regular expression to extract img tag.but its not working

Regex r=new Regex("<img[^<>]+>")

can anybody help out with this?



Thanks in advance.

Regards

Exelio
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,275
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Regarding regular expressions

 
0
  #2
Sep 30th, 2007
Works for me, although I've not tested it exclusively. If you change it to <img([^>]+)>. Make any diff?
Last edited by iamthwee; Sep 30th, 2007 at 8:59 am.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Re: Regarding regular expressions

 
0
  #3
Oct 3rd, 2007
hi,

Ofcourse that makes the difference, thanks a lot.its working now.

Thanks again

Regards

Exelio
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum


Views: 2255 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC