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 4 of 4 pages; Items 61 to 74
Title Test Details Pattern Title
Expression
^\\{2}[\w-]+\\(([\w-][\w-\s]*[\w-]+[$$]?$)|([\w-][$$]?$))
Description
Validates a UNC to conform to \\server\service Must have a "\\" at the start Server may contain alpha/numeric/underscore/dash, Followed by another single "\" Service may contain alpha/numeric/underscore/dash/$/space Note: Service may not start nor end with a space Service may only contain one $, and only at the end No additional "\" may follow afterwards
Matches
\\server\service | \\server\my service | \\serv_001\service$
Non-Matches
\\my server\service | \\server\ service | \\server$\service
Author Rating: Not yet rated. Paul Haines
Title Test Details Pattern Title
Expression
^DOMAIN\\\w+$
Description
In response to a question on the regex list at www.aspadvice.com, this expression should ensure that a login field's username includes a 'DOMAIN\' prefix. The latter part of the expression should probably be limited so that it only allows usernames of appropriate lengths, perhaps 3 to 20 characters (by replacing + with {3,20} for instance).
Matches
DOMAIN\ssmith | DOMAIN\a | DOMAIN\username
Non-Matches
ssmith | username | DOMAIN\
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-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])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&%\$#\=~_\-]+))*$
Description
Ok here's an updated URL regex for you folks. It allows localhost and all TLDs. Feel free to add each country code individually if you want a tighter match.
Matches
http://site.com/dir/file.php?var=moo | https://localhost | ftp://user:pass@site.com:21/file/dir
Non-Matches
site.com | http://site.com/dir//
Author Rating: Not yet rated. Brian Bothwell
Title Test Details Pattern Title
Expression
^(?:(?:25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)(?(?=\.?\d)\.)){4}$
Description
Regular expression for validating a decimal IP address. Matches 4 groups of from 1 to 3 digits, where each group of digits ranges from 0 to 255 in value. Groups of digits must be separated by a single period (.) with no other formatting characters present. Uses conditional regex with lookahead syntax to prevent a match on a period following the final group of digits.
Matches
217.6.9.89 | 0.0.0.0 | 255.255.255.255
Non-Matches
256.0.0.0 | 0127.3 | 217.6.9.89.
Author Rating: Not yet rated. Jerry Schmersahl
Title Test Details UK Domain Names
Expression
^(([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 domain names. Includes the following restrictions from Nominet as at time of posting: 1.Only a-z, 0-9 and hyphen may be used. 2.First or last character may not be a hyphen. 3.Third and fourth characters may not both be hyphens. 4.Third level domain may not be a single character. 5.Third level domain may not be two letters or two numbers. 6.Third level domain may be one letter and one number. This does not yet include the following restrictions: 1.Whole domain may not be longer than 64 characters in length. 2.Third level domain may not duplicate any top/second level domain.
Matches
zeropanic.co.uk | z2.co.uk | 1-1.org.uk
Non-Matches
zeropanic.com | z.co.uk | zz.co.uk
Author Rating: Not yet rated. Amos Hurd
Title Test Details Pattern Title
Expression
(^[a-zA-Z0-9]+://)
Description
Use in a .net Regex.Split() to pull the protocol out of a url into the first array entry.
Matches
myprot://server/path.asp
Non-Matches
server/path.asp
Author Rating: Not yet rated. blake wolf
Title Test Details Pattern Title
Expression
^http://([a-zA-Z0-9_\-]+)([\.][a-zA-Z0-9_\-]+)+([/][a-zA-Z0-9\~\(\)_\-]*)+([\.][a-zA-Z0-9\(\)_\-]+)*$
Description
A very crude url pattern.
Matches
http://www.jonas.no/~webs(i)der/jon_as.php | http://www.yahoo.com/net//ore
Non-Matches
http://www./no/good | imap://www.com/
Author Rating: Not yet rated. Martin Matusiak
Title Test Details Pattern Title
Expression
^([a-zA-Z]\:|\\\\[^\/\\:*?"<>|]+\\[^\/\\:*?"<>|]+)(\\[^\/\\:*?"<>|]+)+(\.[^\/\\:*?"<>|]+)$
Description
This regular expression match any valid file path. It checks local drives and network path. The file extension is required.
Matches
c:\Test.txt | \\server\shared\Test.txt | \\server\shared\Test.t
Non-Matches
c:\Test | \\server\shared | \\server\shared\Test.?
Author Rating: Not yet rated. Roberto Misticoni
Title Test Details Pattern Title
Expression
(mailto\:|(news|(ht|f)tp(s?))\://)(([^[:space:]]+)|([^[:space:]]+)( #([^#]+)#)?)
Description
this is a very little regex for use within a content management software. links within textfields has not to be written in html. the editor of the cms is instructed to use it like this: 1. mention spaces in front and behind the url 2. start url with http://, mailto://, ftp:// ... 3. use optional linktext within #linktext# (separated with single space) 4. if there is no linktext the url/email will show up as linktext 5. avoid url with spaces in filename (use %20 urldecode) replace pattern (space in front): &lt;a href=&quot;\\1\\3\\4&quot; target=&quot;_blank&quot;&gt;\\3\\6&lt;/a&gt;
Matches
http://www.domain.com | http://www.domain.com/index%20page.htm #linktext# | mailto://user@domai
Non-Matches
&lt;a href=&quot;http://www.domain.com&quot;&gt;real html link&lt;/a&gt; | http://www.without_space_
Author Rating: Not yet rated. Martin Schwedes
Title Test Details Pattern Title
Expression
^\[assembly: AssemblyVersion\(\&quot;([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)
Description
using match.Result(&quot;$1.$2.$3.$4&quot;) will return the assembly version of a given c# AssemblyInfo.cs file
Matches
[assembly: AssemblyVersion(&quot;1.0.5.5&quot;)] | [assembly: AssemblyVersion(&quot;1.0.3.5&quot;)]|
Non-Matches
[assembly: AssemblyVersion(&quot;1.0.*&quot;)]
Author Rating: Not yet rated. Yosi Taguri
Title Test Details Pattern Title
Expression
\.com/(\d+)$
Description
This is a regex I wrote to capture requests to AspAlliance.com with an article id as the only thing after the domain. So http://aspalliance.com/123 would go to article number 123. It maps the URL to the actual aspx file that displays the article based on the ID.
Matches
http://aspalliance.com/123 | www.aspalliance.com/123 | http://aspalliance.com/34
Non-Matches
http://aspalliance.com/article.aspx?id=123 | http://aspalliance.com/ | http://aspalliance.com/articl
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)?((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])|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.[a-zA-Z]{2,4})(\:[0-9]+)?(/[^/][a-zA-Z0-9\.\,\?\'\\/\+&amp;%\$#\=~_\-@]*)*$
Description
None of the other URL regex's seemed to work right for me, so i threw this together. works well with PHP's ereg().
Matches
http://www.sysrage.net | https://64.81.85.161/site/file.php?cow=moo's | ftp://user:pass@host.com:123
Non-Matches
sysrage.net
Author Rating: Not yet rated. Brian Bothwell
Title Test Details Pattern Title
Expression
wsrp_rewrite\?(?&lt;wsrp_uri&gt;[\w%:&amp;\\/;.]*)/wsrp_rewrite
Description
Matches a string used to rewrite urls under the WSRP specification. It captures the URL-Encoded string that represents a url. Url validation is not provided.
Matches
wsrp_rewrite?http%3a%2f%2fregexplib.com%3fid%3d1%26message%3dtest/wsrp_rewrite | wsrp_rewrite?http:/
Non-Matches
http%3a%2f%2fregexplib.com%3fid%3d1%26message%3dtest | http://www.regexplib.com/Add.aspx
Author Rating: Not yet rated. Andres Garcia
Title Test Details Pattern Title
Expression
.*?$(?<!\.aspx)
Description
Matches a string to ensure that it does not end with .aspx; sure, you'd probably use string handling to do something this simple but, in the real world you'd whack a regex which validates a valid url to the front of this. The pattern was created by Wayne King; you can read about it here: http://scottwater.com/blog/posts/10204.aspx
Matches
http://weblogs.asp.net/DNeimke/blah.gif
Non-Matches
http://weblogs.asp.net/DNeimke/Default.aspx
Author Rating: Not yet rated. Darren Neimke
Change page:   |    Displaying page 4 of 4 pages; Items 61 to 74

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