User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 456,507 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,663 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 1326 | Replies: 2 | Solved
Reply
Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Regarding regular expressions

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 4,832
Reputation: iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light iamthwee is a glorious beacon of light 
Rep Power: 17
Solved Threads: 324
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: Regarding regular expressions

  #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.
... the hat of 'is this a cat in a hat?'
Reply With Quote  
Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Re: Regarding regular expressions

  #3  
Oct 3rd, 2007
hi,

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

Thanks again

Regards

Exelio
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 3:43 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC