74 regular expressions found in this category!
Displaying page
of
pages;
Items to
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\-\&]+[,]*){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\-\&]+[,]*){2,})|((DC=['\w\d\s\-\&]+[,]*){2,})$ |
Description |
This expression gets a server bound or serverless ldap path without "LDAP://" 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&param2=5&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¶m2=2¶m3=5¶m4=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 "." 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 "." 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): <a href="\\1\\3\\4" target="_blank">\\3\\6</a> |
Matches |
http://www.domain.com | http://www.domain.com/index%20page.htm #linktext# | mailto://user@domai |
Non-Matches |
<a href="http://www.domain.com">real html link</a> | 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\-\._\?\,\'/\\\+&%\$#\=~])*)$ |
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 & 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\(\"([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+) |
Description |
using match.Result("$1.$2.$3.$4")
will return the assembly version of a given c# AssemblyInfo.cs file |
Matches |
[assembly: AssemblyVersion("1.0.5.5")] | [assembly: AssemblyVersion("1.0.3.5")]| |
Non-Matches |
[assembly: AssemblyVersion("1.0.*")] |
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 &lt;a&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 |
|
Non-Matches |
www.deepart.org | deepart.org | 123.123.123.123 |
Author |
Rating:
Not yet rated.
Demo Gorgon
|
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})\/)([^ \[\]\(\),;"'<>\n\r\t]+)([^\. \[\]\(\),;"'<>\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 |
<a\s*.*?href\s*=\s*['"](?!http:\/\/).*?>(.*?)<\/a> |
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 |
<a href='locallink.htm'>my local link</a> | <a title='click here' href="/a/local |
Non-Matches |
<a href='http://www.site.com/page.htm'>www.site.com</a> | <a href='http://www.site.co |
Author |
Rating:
Not yet rated.
james mountain
|
Displaying page
of
pages;
Items to