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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Hyperlink attributes
Expression
(?s)(?<=<a[^>]+?)(?<name>\w+)=(?:["']?(?<value>[^"'>]*)["']?)(?=.+?>)
Description
Captures all attributes in HTML anchor tags, putting them into groups named "name" and "value"
Matches
<a class='foo' href="http://regexplib.com">
Non-Matches
<p align="center">&nbsp;</p>
Author Rating: Not yet rated. Kevin Spencer
Source Kevin Spencer
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Feedback
Name: Frank Butcher
Date: 7/27/2007 7:34:20 AM
Comment:
This also matched any tag beginning in an a, such as the area element of an image map. It really should take into consideration the whitespace following the a.


Title: HYPERLINKS
Name: MATHEWS
Date: 7/8/2007 8:17:50 PM
Comment:
I AM TRYING TO LEARN A WAY OF CREATING MY HYPERLINKS WITHOUT THE LINES UNDER THEM. OR FOR THEM NOT TO BE UNDERLINED UNTIL POINTED AT


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