Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^(((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$ |
Description |
Version 1.3.0: I needed a regexp to validate URL's without the ht(f)tp(s):// and include North American domains (like .us and .ca) and there didn't seem to be one available...so I created one. It will also work with ASP QueryStrings and anchor URL's. If you have a problem with the expression or have any suggestions to improve, please write me and let me know. Added .uk domain and expression now allows for URLs that contain JSP session IDs. 4/14/04 - added ability to include URLs that start with server names. |
Matches |
www.blah.com:8103 | www.blah.com/blah.asp?sort=ASC | www.blah.com/blah.htm#blah |
Non-Matches |
www.state.ga | http://www.blah.ru |
Author |
Rating:
Brad Dobyns
|
Title |
Test
Details
URI Validation & Extraction
|
Expression |
^((http|https|ftp):\/\/)?((.*?):(.*?)@)?([a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])((\.[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])*)(:([0-9]{1,5}))?((\/.*?)(\?(.*?))?(\#(.*))?)?$ |
Description |
Validates and extracts URI components.
Protocol is optional.
Username & Password is optional.
Host regex was taken from Remi Sabourin and follows RFC1035 except that it allows hostnames greater than 253 chars.
Also TLD length is not restriced.
Port number is optional.
Absolute Path is optional, and also extracts the optional querystring and optional anchor reference. |
Matches |
http://john:@www.domain.com:8080/index.html?param=value#Page1 |
Non-Matches |
http://www.domain.com:/ | www-.domain.com |
Author |
Rating:
Not yet rated.
John Bayly
|
Title |
Test
Details
QueryString extract
|
Expression |
<a.*? href=["|'].*\?(?<query>.*?)["|'].*?> |
Description |
Extracts the querystring from a link tag |
Matches |
<a href="Hello.htm?MyValue=1"> |
Non-Matches |
<span>Hello</span> |
Author |
Rating:
Not yet rated.
slolife
|
Title |
Test
Details
Match unanchored urls in unstructured text
|
Expression |
\b((?<!["'>])(?:https?://)?(?<![-@>])(?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])\.)+(?:com|org|net|gov|mil|biz|info|name|aero|mobi|jobs|museum|[A-Z]{2})(?:/[-A-Z0-9\/_.]+)?(?:\?[-A-Z0-9&\._%=,]+)?(?!['"<]))\b |
Description |
Use this regex to match urls (including folder, file and querystring) in unstructured text that are not in anchor tags. Replace with <a href="$1">$1</a> to create anchor tags. |
Matches |
www.shschools.org/community/ethics_conference.html?s=keyword |
Non-Matches |
<a href="www.shschools.org/community/ethics_conference.html?s=keyword">www.shschools.org/community/ethics_conference.html?s=keyword</a> |
Author |
Rating:
Not yet rated.
Bob Clark
|
Title |
Test
Details
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:
Wesley Menezes
|
Title |
Test
Details
Url without Querystring
|
Expression |
((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_\+-=\\\.&]*) |
Description |
Modified URL RegExp that requires (http, https, ftp,gopher,telnet,file|notes,ms-help)://, A nice domain, and a decent file/folder string. |
Matches |
http://regexlib.com/Add.aspx, http://www.regexlib.com/Add.aspx |
Non-Matches |
http://regexlib.com/Search.aspx?k=&c=2&m=-1&ps=20 |
Author |
Rating:
Not yet rated.
jibu georgy issac
|
Title |
Test
Details
Querystring Parse
|
Expression |
(?<=[\?|\&])(?<key>[^\?=\&\#]+)=?(?<value>[^\?=\&\#]*) |
Description |
I wrote this to parse the querystring into its key value parts. It will also match querystring keys without an associated value.
For a nice url parser, look at this one http://regexlib.com/REDetails.aspx?regexp_id=628 |
Matches |
http://www.foo.com/page.aspx?qs1=true&test=foo&bar=true&test#blah |
Non-Matches |
http://www.foo.com/page.aspx |
Author |
Rating:
Tim Cartwright
|
Title |
Test
Details
Optional Querystring
|
Expression |
(?:\?=.*)?$ |
Description |
Add this on to the end of your url rewriting regex to allow an optional querystring to be appended to whatever you are matching. Useful for example when you set up a Google PPC campaign and all of your urls break. Note: doesn't handle #fragments. |
Matches |
?with=querystring | | ?with=multiple&query=strings |
Non-Matches |
?with=querystring#fragment |
Author |
Rating:
Not yet rated.
Matthew Harris
|
Title |
Test
Details
Match Default Document + Optional Querystring
|
Expression |
^~/(?:default\.aspx)?(?:\?=.*)?$ |
Description |
Designed for asp.net default document matching. It allows either a plain url (~/) or a default document url (~/default.aspx) both with an optional querystring. Cassini and IIS7 handle default document matching differently. The user could type it either way. The breadcrumb / sitemap system is funny about omitting default.aspx. Note: Doesn't handle #fragements |
Matches |
/default.aspx | /default.aspx?query=string | / | /?query=string |
Non-Matches |
/default.aspx#fragment | /default.aspx?query=string#fragment | /#fragment | /?query=string#fragment |
Author |
Rating:
Not yet rated.
Matthew Harris
|
Displaying page
of
pages;
Items to