Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - get value from html string over regular expression

 
Thread Tools Search this Thread
Old 11-20-2005, 11:09 AM   #1
Default get value from html string over regular expression


hello,

i have a string that contains the html code of a html-page.

Very important is to know that in the page is a single image. That url i
want to read from the page.

I want to get the url of the image and the content of a "<p"> with a
dedicated classe name (for ex. <p class="descr"> ..."

Example - string variable with url-content - i show only a part of the
content.
vMyHtmlString=".......<TR><TD colspan="2"><img
src='/image/myimages.asp?id=I368' align=LEFT></TD>
<TD VALIGN=TOP><p class=descr>Adobe Acrobat ....</p></TD>
</TR></TABLE></P>...."

I want to get the values:
-> /image/myimages.asp?id=I368
and the content from "<p class... </p>"
-> Adobe Acrobat ....
Adobe Acrobat ....

thanks


=?Utf-8?B?dGQxMzY5?=
  Reply With Quote
Old 11-20-2005, 12:49 PM   #2
Kevin Spencer
 
Posts: n/a
Default Re: get value from html string over regular expression
This one will give you the "src" - afraid I have no time to do the other
right now. I'll be back in a week!

(?i)(?s)(<img)??(?<!\1)src=["]?([^\s"]*)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

"td1369" <> wrote in message
news:29D045FE-928D-4B5A-A70E-...
> hello,
>
> i have a string that contains the html code of a html-page.
>
> Very important is to know that in the page is a single image. That url i
> want to read from the page.
>
> I want to get the url of the image and the content of a "<p"> with a
> dedicated classe name (for ex. <p class="descr"> ..."
>
> Example - string variable with url-content - i show only a part of the
> content.
> vMyHtmlString=".......<TR><TD colspan="2"><img
> src='/image/myimages.asp?id=I368' align=LEFT></TD>
> <TD VALIGN=TOP><p class=descr>Adobe Acrobat ....</p></TD>
> </TR></TABLE></P>...."
>
> I want to get the values:
> -> /image/myimages.asp?id=I368
> and the content from "<p class... </p>"
> -> Adobe Acrobat ....
> Adobe Acrobat ....
>
> thanks





Kevin Spencer
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Give you enough string functions in Java web reporting tool freezea Software 0 10-08-2009 09:03 AM
Java String Problems rbnbenjamin General Help Related Topics 0 02-03-2009 11:02 PM
Hidden linebreaks in string? VB.NET Jiggy Software 0 04-23-2008 02:18 PM
my first question :save mht file from a html string yours Software 0 05-12-2007 01:49 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46