Link to home
Start Free TrialLog in
Avatar of johnywhite
johnywhite

asked on

Parse out HTML tags with VB.Net and Regular Expressions

I have string that is an HTML page from my DB. What I want to do is search through the string and get all <img tags that have the height or width set, and change the src on each of them. I am not very good with Regular Expressions so I was hoping someone out there could help me out.
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Hi johnywhite;

Can you post some actual samples of the img tags?

Also:
Will the height always come before the width or the other way around or in any sequence?
Will there be other attributes with the image tag? if so what order will they be in respect to height and width?
Is the part of the source that will change be the same and will the replacement be the same?

In order to do what you want the exact pattern of what must be changed must be known and what to change must be known. So can you give a specification.

Thanks;
Fernando
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of johnywhite
johnywhite

ASKER

CodeCruiser I like that method. Thanks!
You are welcome.