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
((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
^(?<link>((?<prot>http:\/\/)*(?<subdomain>(www|[^\-\n]*)*)(\.)*(?<domain>[^\-\n]+)\.(?<after>[a-zA-Z]{2,3}[^>\n]*)))$
Description
I wrote this after I couldn't find an expression that would search for valid URLs, whether they had HTTP in front or not. This will find those that don't have hyphens anywhere in them (except for after the domain).
Matches
http://www.google.com | www.123google.com | www.google.com/help/me
Non-Matches
-123google.com | http://-123.123google.com
Author Rating: Not yet rated. Joe Pontani
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 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
^[^\\\./:\*\?\"<>\|]{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
(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
^(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
[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
^\[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
\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
9[0-9]
Description
Matches
541942245
Non-Matches
5561751632232
Author Rating: Not yet rated. vijay gali
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
^([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
&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
Change page:   |    Displaying page 4 of 4 pages; Items 61 to 74

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