943,744 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 3437
  • C# RSS
Sep 29th, 2007
0

Regarding regular expressions

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Exelio is offline Offline
57 posts
since Aug 2006
Sep 30th, 2007
0

Re: Regarding regular expressions

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.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Oct 3rd, 2007
0

Re: Regarding regular expressions

hi,

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

Thanks again

Regards

Exelio
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Exelio is offline Offline
57 posts
since Aug 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: C# and .Net 1.0
Next Thread in C# Forum Timeline: Database Connection





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC