RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(?:(?<scheme>[a-z]+):\/\/)?(?:(?<usern>[a-z0-9_.]*)(?::(?<passw>[a-z0-9_.]*))?@)?(?<domain>(?:(?:[a-z][a-z0-9_-]+\.?)+|[0-9]{1,3}(?:\.[0-9]{1,3}){3}))(?::(?<port>[0-9]+))?(?<path>(?:\/[.%a-z0-9_]*)+)?(?:\?(?<query>(?:&?[][a-z0-9_]+(?:\=?[a-z0-9_;]*)?)+))?(?:#(?<fragment>[a-z0-9_]+))?$
Description
Matches URI's! "filename.ext" is part of path. ER can't differ file name from directory name. only domain is required. scheme://usern:passw@domain:port/path/file.ext?querystring#fragment
Matches
domain | ftp://localhost:21/ | 192.168.254.0 | http://username:[email protected]:1234/path1/pathX/filename.ext?query=string&example=v1#fragment
Non-Matches
non-alpha://domain | domain:non-number
Author Rating: The rating for this expression. Wesley Menezes
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

Title: syntax error in reg exp
Name: jeff
Date: 6/20/2008 4:40:19 PM
Comment:
hi... when testing on this site with ie6 and the js client engine, i get a syntax error in the regular expression.


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