get value from html string over regular expression

G

Guest

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
 
K

Kevin Spencer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top