-
How to Parse an HTML Tag for its Attributes
I have not used regular expressions before but by saerching the web and experimenting I managed to cobble together an expression that identifies all html tags includding multi-line comments <!-- ... -->.
I don't completely understand the expression but enough to get it to work.
Which is what counts!
The next step is to identify each tags attributes and their values.
Everything I have tried fails when an attributes value is a string that contains text that looks like another attribute/value pair.
I am using VB.Net 2005
This is my Attribute finding expression so far: "(\s\b[^=]*=)"
Between any two attributes is the previous attributes value and the last ones value simply runs to the end of the tag. This method would work if I could get it to ingnore the text within the string values, just like it ignores numeric values.
Thanks in advance!
Similar Threads
-
Replies: 4
Last Post: 08-22-2008, 02:12 AM
-
Replies: 1
Last Post: 03-03-2005, 03:41 AM
-
By ac7117 in forum ASP.NET
Replies: 0
Last Post: 01-30-2002, 04:52 PM
-
Replies: 0
Last Post: 01-30-2002, 01:51 PM
-
By Henry White in forum XML
Replies: 0
Last Post: 04-22-2000, 04:08 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks