RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Extract quoted attributes from HTML tag
Expression
(?<tagname>[^\s]*)="(?<tagvalue>[^"]*)"
Description
Quick and dirty extraction of quoted HTML attributes if you begin with just the tag string. Not intended for use in a full HTML document.
Matches
<tag attr1="value1"> | <tag attr1="value1" attr2="value2">
Non-Matches
<tag attr1="value1> | <tag attr1=value1"> | <tag attr1=value1>
Author Rating: The rating for this expression. Mitch Baker
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials