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 URL
Expression
^(http|https|ftp|ftps)\://([a-zA-Z0-9\-]+)(\.[a-zA-Z0-9\-]+)*(\.[a-zA-Z]{2,3})(:[0-9]*)?(/[a-zA-Z0-9_\-]*)*(\.?[a-zA-Z0-9#]{1,10})?([\?][a-zA-Z0-9\-\._\,\'\+&%\$#\=~]*)?$
Description
Matches basic URL strings with optional query string. Remarks: to use this expression in JavaScript you should do the following: 1) when using RegExp("pattern") object you should escape all '\' instances, because they appear in double quotes. 2) when using /pattern/flags syntax, you should escape all '/' instances, because this character indicates an end of an expression.
Matches
http://example.com https://www.example.com:8080/path/path/ http://www.example.com/path/page.html?p1=param1&p2=param2
Non-Matches
example.com http://example.c http://example.com/page.
Author Rating: Not yet rated. Dmitry Tranchenko
   Displaying page 1 of 1 pages; Items 1 to 1

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