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 Pattern Title
Expression
href=[\"\'](http:\/\/|\.\/|\/)?\w+(\.\w+)*(\/\w+(\.\w+)?)*(\/|\?\w*=\w*(&\w*=\w*)*)?[\"\']
Description
I wrote up this regular expression to fetch the href attribute found in <a> tags as well as a few other HTML tags.
Matches
href="www.yahoo.com" | href="http://localhost/blah/" | href="eek"
Non-Matches
href="" | href=eek | href="bad example"
Author Rating: The rating for this expression. Andrew Lee
   Displaying page 1 of 1 pages; Items 1 to 1

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