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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
<a[a-zA-Z0-9 ="'.?_/]*(href\s*=\s*){1}[a-zA-Z0-9 ="'.?_/]*\s*((/>)|(>[a-zA-Z0-9 ="'<>.?_/]*</a>))
Description
An expression that matches all XHTML valid hrefs (links). It even alows spaces like href = "href...", dough this is not quite XHTML valid. It finds only hrefs but not for instance anchors. If you need to find only anchors, replace "href" within expression with "name" and thats it.
Matches
<a href="www.google.com">Google</a> | <a href=www.google.com /> | <a
Non-Matches
<a name="anchor">Anchor</a> | <img src="image.gif">
Author Rating: The rating for this expression. AleŇ° Potocnik
Source
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

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