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 3 of 4 pages; Items 41 to 60
Title Test Details Pattern Title
Expression
^[^\\\./:\*\?\"<>\|]{1}[^\\/:\*\?\"<>\|]{0,254}$
Description
Validates a long filename using Windows' rules. Requires one valid filename character other than &quot;.&quot; for the first character and then any number of valid filename characters up to a total length of 255 characters. Unresolved is how to prevent the last character from being a &quot;.&quot; while still meeting all the features that this regex does now.
Matches
abcd.jpg | a b239.abcd ef12983 298 | a....23498
Non-Matches
.abcde.jpg | abcde?.jpg | c:\abcde.jpg
Author Rating: Not yet rated. Dale Preston
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
^((\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
^([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
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
^[a-z]+([a-z0-9-]*[a-z0-9]+)?(\.([a-z]+([a-z0-9-]*[a-z0-9]+)?)+)*$
Description
A simple regex which should validate a domain name according to RFC 1035 updated to match domain names with hyphens
Matches
www.domain.com | w123.d42omain.c43om | ww-w.d-omain.com
Non-Matches
1www.domain.com | www.1domain.com | www.domain.com-
Author Rating: Not yet rated. Tinus Norstved
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: Not yet rated. James Tikitiki
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
&lt;a\s*.*?href\s*=\s*['&quot;](?!http:\/\/).*?&gt;(.*?)&lt;\/a&gt;
Description
Finds all local links, but doesnt match on external links. Use replace with $1 to leave the link text but remove the link.
Matches
&lt;a href='locallink.htm'&gt;my local link&lt;/a&gt; | &lt;a title='click here' href=&quot;/a/local
Non-Matches
&lt;a href='http://www.site.com/page.htm'&gt;www.site.com&lt;/a&gt; | &lt;a href='http://www.site.co
Author Rating: Not yet rated. james mountain
Title Test Details Pattern Title
Expression
^([a-zA-Z]\:)(\\[^\\/:*?<>"|]*(?<![ ]))*(\.[a-zA-Z]{2,6})$
Description
Matches filenames. UPDATED on 1st Jan 2004.
Matches
C:\di___r\fi_sysle.txt | c:\dir\filename.txt
Non-Matches
c:\dir\file?name.txt
Author Rating: Not yet rated. Darren Neimke
Title Test Details Pattern Title
Expression
\b(((\S+)?)(@|mailto\:|(news|(ht|f)tp(s?))\://)\S+)\b
Description
Whilst writing a plain-text to HTML function, I ran into the problem of links that users had written with &amp;lt;a&amp;gt; tags (as opposed to just writing the URL) were linking improperly. This regular expression returns many types of URL, and preceding characters, if any. This allows you to handle each type of match appropriately
Matches
href='http://www.deepart.org' | [email protected] | ftp://123.123.123.123
Non-Matches
www.deepart.org | deepart.org | 123.123.123.123
Author Rating: Not yet rated. Demo Gorgon
Title Test Details Pattern Title
Expression
^(http|https|ftp)\://(((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|([a-zA-Z0-9_\-\.])+\.(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|uk|me))((:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&amp;%\$#\=~])*)$
Description
First attempt at reg ex - work in progress - can't quite get it to work absolutely correctly so any comments would be great. Matches everything as it should apart from the last part of the IP, i.e. allows http://255.255.255.999 (which obviously it shouldn't but ran out of inspiration) so any corrections humbly and gratefully accepted. TLD check is not complete - just added most of the major ones but easy to dd to if you want to. BTW - you'll need to replace the &amp; with just the ampersand in the reg ex
Matches
http://www.allkins.com | http://255.255.255.255 | http://allkins.com/page.asp?action=1
Non-Matches
http://test.testing
Author Rating: Not yet rated. Dominic Allkins
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
[0-9A-Fa-f]{2}(\.?)[0-9A-Fa-f]{2}(\.?)[0-9A-Fa-f]{2}(\.?)[0-9A-Fa-f]{2}
Description
matches IP address in hex form in dotted or not dotted notation
Matches
c0.a8.01.64 | 0A0275C4 | aC.10.1F.b1
Non-Matches
192.168.1.1 | 10.2.177.4 | ah.10.1f.20
Author Rating: Not yet rated. David Tersigni
Title Test Details Pattern Title
Expression
^(?=[^&])(?:(?<scheme>[^:/?#]+):)?(?://(?<authority>[^/?#]*))?(?<path>[^?#]*)(?:\?(?<query>[^#]*))?(?:#(?<fragment>.*))?
Description
Use it for breaking-down a URI (URL, URN) reference into its main components: Scheme, Authority, Path, Query and Fragment. This is not a simple match regular expression. so it not works to verify a URI. It returns 1 matching group for each URI component. For example, for the following URI: http://regexlib.com/REDetails.aspx?regexp_id=x#Details returns: scheme=&quot;http&quot;, authority=&quot;regexlib.com&quot;, path=&quot;/REDetails.aspx&quot;, query=&quot;regexp_id=x&quot; and fragment=&quot;Details&quot;. This is a W3C raccomandation (RFC 2396).
Matches
http://regexlib.com/REDetails.aspx?regexp_id=x#Details
Non-Matches
&
Author Rating: Not yet rated. Frederico Knabben
Title Test Details Pattern Title
Expression
([a-zA-Z]:(\\w+)*\\[a-zA-Z0_9]+)?.xls
Description
This RegEx will help to validate a physical file path with a specific file extension (here xls)
Matches
E:\DyAGT\SD01A_specV2.xls
Non-Matches
E:\DyAGT\SD01A_specV2.txt
Author Rating: Not yet rated. vinod kumar
Title Test Details Pattern Title
Expression
\[link="(?<link>((.|\n)*?))"\](?<text>((.|\n)*?))\[\/link\]
Description
This can be used in conjunction with the replace method to provide pseudo-code support without having to enable HTML. The replacement string (in ASP.NET, use RegExp.Replace(SourceString, RegularExpressionPattern, ReplacementString) is &lt;a href=&quot;${link}&quot;&gt;${text}&lt;/a&gt;.
Matches
[link="http://www.yahoo.com"]Yahoo[/link]
Non-Matches
[link]http://www.yahoo.com[/link] | [link=http://www.yahoo.com]Yahoo[/link]
Author Rating: Not yet rated. Ryan S
Title Test Details Pattern Title
Expression
^([a-zA-Z]\:|\\)\\([^\\]+\\)*[^\/:*?"<>|]+\.htm(l)?$
Description
Validates a file path on your local drive or a network drive. A similar one was written by Vinod Kumar but it does not reject asterisks in the path. Moreover, his did not work with RegularExpressionValidators. This one does.
Matches
x:\test\testing.htm | x:\test\test#$ ing.html | \\test\testing.html
Non-Matches
x:\test\test/ing.htm | x:\test\test*.htm | \\test?&lt;.htm
Author Rating: Not yet rated. asdf asdfa
Change page:   |    Displaying page 3 of 4 pages; Items 41 to 60

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