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 RFC URL
Expression
(([\w]+:)?//)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?
Description
A pretty decent URL matching expression. I've followed most RFC guidelines, so it'll match most anything ya throw at it (And wont match what it's not supposed to). If you see any problems with it, please email me so I can make the appropriate changes :)
Matches
http://www.domain.com | http://domain.com | http://domain.com | https://domain.com | https://sub.domain-name.com:8080 | http://domain.com/dir%201/dir_2/program.ext?var1=x&var2=my%20value | domain.com/index.html#bookmark
Non-Matches
Normal Text. | http://a.com | http://www.domain-.com
Author Rating: The rating for this expression. r4cc00n
   Displaying page 1 of 1 pages; Items 1 to 1

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