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

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

74 regular expressions found in this category!

Expressions in category: Uri

Change page:   |    Displaying page 2 of 4 pages; Items 21 to 40
Title Test Details Pattern Title
Expression
^(((ht|f)tp(s?))\://)?((([a-zA-Z0-9_\-]{2,}\.)+[a-zA-Z]{2,})|((?:(?:25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)(?(\.?\d)\.)){4}))(:[a-zA-Z0-9]+)?(/[a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~]*)?$
Description
Hopefully an all-encompassing expression to validate a URL. Supports an optional protocol, either a domain or IP address, an optional port number and an optional path.
Matches
this.com | https://this.com:8080/this/this.htm | ftp://255.255.255.255/
Non-Matches
.this.com | https://this.com:/ | ftps://255.256.255.255/
Author Rating: The rating for this expression. Tom Hartland
Title Test Details Pattern Title
Expression
(?<http>(http:[/][/]|www.)([a-z]|[A-Z]|[0-9]|[/.]|[~])*)
Description
This is HTTP Url extractor
Matches
http://www.abc.com | www.mpgrewal.tk
Non-Matches
noida-India | crazy123
Author Rating: The rating for this expression. Manpreet Grewal
Title Test Details Pattern Title
Expression
(((ht|f)tp(s?):\/\/)|(www\.[^ \[\]\(\)\n\r\t]+)|(([012]?[0-9]{1,2}\.){3}[012]?[0-9]{1,2})\/)([^ \[\]\(\),;&quot;'&lt;&gt;\n\r\t]+)([^\. \[\]\(\),;&quot;'&lt;&gt;\n\r\t])|(([012]?[0-9]{1,2}\.){3}[012]?[0-9]{1,2})
Description
v2 A general purpose expresion to find url's (improved). Add heads to first part, example: ((imap:|(ht|f)tp(s?):\/\/)|(www\. to find url's like imap://www.com/, so ip's. No ipv6 (yet)
Matches
www.domain.com | http://www.blah.ru | https://192.168.0.2:80/users/~fname.lname/file.ext
Non-Matches
imap://.com
Author Rating: The rating for this expression. James Tikitiki
Title Test Details Pattern Title
Expression
^(((((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])-(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]))|((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]))),)*)(((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-
Description
Matches comma-separated list of IP address and IP ranges. E.g. 192.168.101.1-192.168.101.255,192.168.102.12
Matches
192.168.101.1 | 192.168.101.1-192.168.101.255 | 192.168.101.1-192.168.101.255,192.168.102.12
Non-Matches
999.168.101.1 | 192.168.101.1- | -192.168.101.255
Author Rating: The rating for this expression. Gregory Entin
Title Test Details Pattern Title
Expression
^[a-zA-Z0-9]+([a-zA-Z0-9\-\.]+)?\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$
Description
Checks domain names. This is an attempt to deal with some of the issues of the other reg ex in not handling leading periods(.) and hypens(-).
Matches
my.domain.com | regexlib.com | big-reg.com
Non-Matches
.mydomain.com | regexlib.comm | -bigreg.com
Author Rating: The rating for this expression. Stewart Haddock
Title Test Details Pattern Title
Expression
(((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp)://)|(www\.))+(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9\&amp;%_\./-~-]*)?
Description
You can use this regular expression in your PHP scripts to convert entered URL in text to URL link. Example: $text=ereg_replace(&quot;(((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp)://)|(www\.))+(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9\&amp;%_\./-~-]*)?&quot;,&quot;&lt;a href=\&quot;./redir.php?url=\\0\&quot; target=\&quot;_blank\&quot;&gt;\\0&lt;/a&gt;&quot;,$text);
Matches
http://diskusneforum.sk | www.diskusneforum.sk | ftp://123.123.123.123/
Non-Matches
diskusneforum.sk
Author Rating: The rating for this expression. Martin Ille
Title Test Details Pattern Title
Expression
[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
Description
Very Simple Match for dotted Decimal IP address. Doesn’t Validate addresses
Matches
192.168.1.1 | 10.2.234.1 | 66.129.71.122
Non-Matches
192.168.1 | 10.2.1234.1 | 66 129 71 122
Author Rating: The rating for this expression. David Tersigni
Title Test Details Pattern Title
Expression
(^\d{3}\x2E\d{3}\x2E\d{3}\x2D\d{2}$)
Description
Brazilian cpf
Matches
123.123.123-12
Non-Matches
123.123.103.32 | 123 123 123 12 | sa3.332.322-12
Author Rating: The rating for this expression. Carlos R. L. Rodrigues
Title Test Details Pattern Title
Expression
^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$
Description
Matches simple IP addresses. It's not too complex or long, but it does the job if you want something short/simple.
Matches
113.173.40.255 | 171.132.248.57 | 79.93.28.178
Non-Matches
189.57.135 | 14.190.193999 | A.N.D.233
Author Rating: The rating for this expression. Jag fire
Title Test Details UK Domain Names with Protocol
Expression
^(ht|f)tp((?<=http)s)?://((?<=http://)www|(?<=https://)www|(?<=ftp://)ftp)\.(([a-z][0-9])|([0-9][a-z])|([a-z0-9][a-z0-9\-]{1,2}[a-z0-9])|([a-z0-9][a-z0-9\-](([a-z0-9\-][a-z0-9])|([a-z0-9][a-z0-9\-]))[a-z0-9\-]*[a-z0-9]))\.(co|me|org|ltd|plc|net|sch|ac|mod|nhs|police|gov)\.uk$
Description
UK domains with protocol for http/https/ftp. Based on my previous expression, this allows the subdomain &quot;www&quot; for the http/https protocols, or &quot;ftp&quot; for the ftp protocol only.
Matches
http://www.zeropanic.co.uk | ftp://ftp.sunsite.ac.uk | https://www.z2.co.uk
Non-Matches
gopher://www.z2.co.uk | http://ftp.z2.co.uk | ftp://www.z2.co.uk
Author Rating: Not yet rated. Amos Hurd
Title Test Details Pattern Title
Expression
^(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}/(DC=['\w\d\s\-\&amp;]+[,]*){2,})|((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])/(DC=['\w\d\s\-\&amp;]+[,]*){2,})|((DC=['\w\d\s\-\&amp;]+[,]*){2,})$
Description
This expression gets a server bound or serverless ldap path without &quot;LDAP://&quot; in front of it.
Matches
aa.com/dc=ll,dc=ll | 181.168.5.5/dc=cc,dc=ll | dc=ll,dc=aa
Non-Matches
a/dc=aa | aa.com | 181.168.5.5
Author Rating: Not yet rated. Ariana Bauer
Title Test Details UK Domain Names with Protocol and Port
Expression
^(ht|f)tp((?<=http)s)?://((?<=http://)www|(?<=https://)www|(?<=ftp://)ftp)\.(([a-z][0-9])|([0-9][a-z])|([a-z0-9][a-z0-9\-]{1,2}[a-z0-9])|([a-z0-9][a-z0-9\-](([a-z0-9\-][a-z0-9])|([a-z0-9][a-z0-9\-]))[a-z0-9\-]*[a-z0-9]))\.(co|me|org|ltd|plc|net|sch|ac|mod|nhs|police|gov)\.uk(:\d+)?\/?$
Description
UK http/https/ftp URI. Based on my previous expression, this one takes an optional port number and optional trailing slash.
Matches
http://www.zeropanic.co.uk/ | http://www.zeropanic.co.uk:81/ | http://www.zeropanic.co.uk:81
Non-Matches
http://www.zeropanic.com:81/
Author Rating: Not yet rated. Amos Hurd
Title Test Details Pattern Title
Expression
[a-zA-Z]{3,}://[a-zA-Z0-9\.]+/*[a-zA-Z0-9/\\%_.]*\?*[a-zA-Z0-9/\\%_.=&amp;]*
Description
A simple url search pattern that works against the most generic cases. A little better in terms of matches than the other URL expressions listed.
Matches
http://someserver | http://www.someserver.com/ | http://www.someserver.com/somefile.txt
Non-Matches
Thin | Lizzy
Author Rating: Not yet rated. Gerrard Lindsay
Title Test Details Pattern Title
Expression
([^\=&]+)(?<!param1|param2|param3)\=([^\=&]+)(&)?
Description
this regex eleminates all parameters from a html querry e.g. param1=hans&amp;param2=5&amp;badparam=5 so bad param will be deleted from the params given. its usefull to clean up urls from unwanted params you not allow befor using the query string for further issues.
Matches
param1=2&param2=2&param3=5&param4=9
Non-Matches
none
Author Rating: Not yet rated. Ludwig Gramberg
Title Test Details Pattern Title
Expression
((http\://|https\://|ftp\://)|(www.))+(([a-zA-Z0-9\.-]+\.[a-zA-Z]{2,4})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9%:/-_\?\.'~]*)?
Description
This RE matches the web links which begin http://, ftp://, https:// or www. You can edit this disadvantage easy...
Matches
www.diskusneforum.sk | http://diskusneforum.sk | ftp://23.45.267.189/
Non-Matches
diskusneforum.sk | localhost
Author Rating: Not yet rated. Martin Ille
Title Test Details Pattern Title
Expression
href\s*=\s*(?:(?:\&quot;(?&lt;url&gt;[^\&quot;]*)\&quot;)|(?&lt;url&gt;[^\s*] ))&gt;(?&lt;title&gt;[^&lt;]+)&lt;/\w&gt;
Description
finds the url and url description for all links in a given text.
Matches
&lt;td bgcolor=&quot;#ffffff&quot; class=&quot;small&quot;&gt;&amp;nbsp;&lt;A HREF=&quot; http://
Non-Matches
&lt;td bgcolor=&quot;#ffffff&quot; class=&quot;small&quot;&gt;&amp;nbsp;&lt;A HREF http://www.thepla
Author Rating: Not yet rated. Matt Bruce
Title Test Details Pattern Title
Expression
9[0-9]
Description
Matches
541942245
Non-Matches
5561751632232
Author Rating: Not yet rated. vijay gali
Title Test Details Pattern Title
Expression
^([a-zA-Z].*|[1-9].*)\.(((j|J)(p|P)(g|G))|((g|G)(i|I)(f|F)))$
Description
Regular expression to limit types of files accepted. This example matches .jpg and .gif files only.
Matches
filename.jpg | FileName.JPG | filename.gif
Non-Matches
filename.png | filename.xxx | filename.bmp
Author Rating: Not yet rated. Ramon Hildreth
Title Test Details Pattern Title
Expression
^((\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5])\.(\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5])\.(\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5])\.(\d|\d\d|[0-1]\d\d|2[0-4]\d|25[0-5]))$
Description
Matches valids TCP/IP-Adresses
Matches
1.198.0.1 | 100.10.0.1 | 200.200.123.123
Non-Matches
..12.23 | a.23.345 | 400.500.300.300
Author Rating: Not yet rated. Karsten Sosna
Title Test Details Pattern Title
Expression
^\\([^\\]+\\)*[^\/:*?&quot;&lt;&gt;|]?$
Description
Orginally on this site search for Path, go to next page you see a reg expression for ^([a-zA-Z]\:|\\)\\([^\\]+\\)*[^\/:*?&quot;&lt;&gt;|]+\.htm(l)?$ which I modified with this one to disallow drive specification.
Matches
\temp\ | \temp\content\ | \Program Files\
Non-Matches
a:\Temp\ | \Temp\Content | c:\Program Files\
Author Rating: Not yet rated. Rod DeValcourt
Change page:   |    Displaying page 2 of 4 pages; Items 21 to 40

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