- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
Retrieves all anchor links in a html document, useful for spidering. You will need to do a replace of " and ' after the regular expression, as the expression gets all links. As far as I know there is no way, even with \1 groupings, of getting a condition on whether the link contains a ",' or nothing at all (" and ' is easy enough, but what happens if the link starts with ", and has a javascript function call with a string in it). If there is, it's probably quicker to do it like this and do a string replace anyway.
<a href=""> | <a href='../blah.html' target="_top"&a
<a href = >
Author Rating: The rating for this expression. chris s
Your Rating
Bad Good

Enter New 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: Good But displayed wrong
Name: Regex Newbie
Date: 8/3/2008 3:13:29 PM
This regex is displayed wrong, it says &lt when really it should say < and &gt instead of > , &quot instead of " When you correct it, it works just lovely on Visual Basic 6. To give you: <a href="">

Copyright © 2001-2021, | ASP.NET Tutorials