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 ="'.:;?]*(name=){1}[a-zA-Z0-9 ="'.:;?]*\s*((/>)|(>[a-zA-Z0-9 ="'<>.:;?]*</a>))
Description
This expression matches only valid html anchors. Those are anchors with an attribute name=. Such anchor can be closed either with </a> or with />. If someone can help - one thing still missing is not matching html tags with parameter href, becazse such should be considered as non valid anchors.
Matches
<a name="anchorName">Anchor</a> | <a name=anchorName />
Non-Matches
<a href="somewhere"> | <a href> | <a name />
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-2024, RegexAdvice.com | ASP.NET Tutorials