Displaying page
of
pages;
Items to
| Title |
Test
Details
Pattern Title
|
| Expression |
([\d\w-.]+?\.(a[cdefgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmnoz]|e[ceghrst]|f[ijkmnor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eouw]|s[abcdeghijklmnortuvyz]|t[cdfghjkmnoprtvwz]|u[augkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]|aero|arpa|biz|com|coop|edu|info|int|gov|mil|museum|name|net|org|pro)(\b|\W(?<!&|=)(?!\.\s|\.{3}).*?))(\s|$) |
| Description |
This will find URLs in plain text. With or without protocol. It matches against all toplevel domains to find the URL in the text. |
| Matches |
http://www.website.com/index.html | www.website.com | website.com |
| Non-Matches |
Works in all my tests. Does not capture protocol. |
| Author |
Rating:
James Johnston
|
| Title |
Test
Details
Pattern Title
|
| Expression |
<a\s*href=(.*?)[\s|>] |
| Description |
Retrieves all anchor links in a html document, useful for spidering. You will need to do a replace of " and ' after the regular expression, as the expression gets all links. As far as I know there is no way, even with \1 groupings, of getting a condition on whether the link contains a ",' or nothing at all (" and ' is easy enough, but what happens if the link starts with ", and has a javascript function call with a string in it). If there is, it's probably quicker to do it like this and do a string replace anyway. |
| Matches |
<a href="http://www.blah.com"> | <a href='../blah.html' target="_top"&a |
| Non-Matches |
<a href = http://www.idiothtmlprogrammers.com > |
| Author |
Rating:
chris s
|
| Title |
Test
Details
ISBN
|
| Expression |
/((978[\--– ])?[0-9][0-9\--– ]{10}[\--– ][0-9xX])|((978)?[0-9]{9}[0-9Xx])/ |
| Description |
match isbn 10 and 13
|
| Matches |
978-1-4302-1998-9 | 1–931836–59–0 | 1593270127 | 0 321 15420 7 | 978-0-07-162612-5 |
| Non-Matches |
978-0-07-1626125 | 15932701X7 | 970-0-596-52678-8 |
| Author |
Rating:
Not yet rated.
Santiago Neira
|
| Title |
Test
Details
Single Email Match - current June 2010
|
| Expression |
^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2}|aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel)$ |
| Description |
Matches email addresses. Based on expression at regular-expressions.info/email.html modified to include all top-level domains (TLD)listed on wikipedia as of June 2010. Needs to be updated as new TLDs are added.
Known Issues:
* IP Addresses will not validate
* Double "at" symbols, e.g. email@em@il.com slip by this regex. Would welcome improvements by a regex ninja. |
| Matches |
email@email.com | email@email.cn | e_m81l&em%'l@eMail.MUSEUM | email@em@il.com |
| Non-Matches |
email@com | email@email.con | email@email.museet | email@192.0.0.1 |
| Author |
Rating:
Not yet rated.
Brent Thomas
|
| Title |
Test
Details
International & Domestic Phone Numbers with Ext
|
| Expression |
^([\+][0-9]{1,3}([ \.\-])?)?([\(]{1}[0-9]{3}[\)])?([0-9A-Z \.\-]{1,32})((x|ext|extension)?[0-9]{1,4}?)$ |
| Description |
Somewhat conservative expression for evaluating phone numbers. Based off ideas found at http://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation this allows country codes, with or without the + symbol, area codes surrounded by parenthesis (or not) and numbers delimited by spaces, periods or dashes. You'll want to independently test for string length based on your needs. |
| Matches |
(123)456-7890 | (123)456-7890 x123 | +1 (123)456-7890 | 12 3456 789 0 x1234 | (123)456-7890x123 |(123)456-7890ext123 | (123)456-7890 extension123 | 123.456.7890 | 1234567890 | 1234567 | 12 34 56 78 90 | 12 3 4567 890123 x4567 | +12 3456 7890 | +12 34 56 7890 | +12 3456 7890 | +12 34567890 |
| Non-Matches |
(123)456-7890 x 123 | 123.45.6.78+90 |
| Author |
Rating:
Brent Thomas
|
| Title |
Test
Details
Date Match
|
| Expression |
^(d{0}|(31(?!(FEB|APR|JUN|SEP|NOV)))|((30|29)(?!FEB))|(29(?=FEB(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(29(?=FEB(((0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\d|2[0-8])(JAN|FEB|MAR|MAY|APR|JUL|JUN|AUG|OCT|SEP|NOV|DEC)((1[6-9]|[2-9]\d)\d{2}|\d{2}|d{0})$ |
| Description |
This pattern mathces the following date formats: DDMMMYY,DDMMMYYYY,DDMMMYY. The Pattern matches on leap year dates as well |
| Matches |
12MAR02 | 12MAR2008 | 29FEB2008 | 12MAR |
| Non-Matches |
29FEB2007 | 32MAR | 00APR |
| Author |
Rating:
Ole
|
| Title |
Test
Details
Scientific Notation
|
| Expression |
^(-?[1-9](\.\d+)?)((\s?[X*]\s?10[E^]([+-]?\d+))|(E([+-]?\d+)))$ |
| Description |
Matches both normalized and E notations, with or without spaces or negative numbers. Make sure to use a case insensitive pattern matcher. Group 1 is the significand, and either group 5 or group 7 is the exponent (one or the other will be null, but never both). |
| Matches |
1.1 x 10^9 | 2.34 X 10^12 | 3.14159 * 10^30 | 1.1x10^9 | 2.34X10^12 | 3.14159*10^30 | 1.1 x 10e9 | 2.34 x 10E12 | 3.14159e30 | 1.1 x 10^-9 | 2.34 X 10^-12 | 3.14159E-30 | -1.1 x 10^9 | -2.34 X 10E12 | -3.14159 * 10e30 | -1.1x10^-9 | -2.34E-12 | -3.14159e-30 | 3.1459E+030 | 1x10^9 | 1E9 |
| Non-Matches |
0.1 x 10^9 | 23.4 x 10^12 | 3.14159 * 10e^30 | 1.1e8.3 |
| Author |
Rating:
Jared Cook
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$ |
| Description |
Used to validate Credit Card numbers, Checks if it contains 16 numbers in groups of 4 separated by -, ,or nothing |
| Matches |
1111-2323-2312-3434 | 1234343425262837 | 1111 2323 2312 3434 |
| Non-Matches |
1111 2323 2312-3434 | 34323423 | 1111-2323-23122-3434 |
| Author |
Rating:
Not yet rated.
Sachin Bhatt
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([a-zA-Z '-]+)$ |
| Description |
Check if the text is a valid firstname or lastname.It allows Characters,'- and space only |
| Matches |
Sachin Bhatt | D'Souza | Ul-Haq |
| Non-Matches |
sac2hin | sc*& | sac)in |
| Author |
Rating:
Sachin Bhatt
|
| Title |
Test
Details
FQDN for DNS configuration tool
|
| Expression |
^(?=^.{1,254}$)(^(?:(?!\.|-)([a-z0-9\-\*]{1,63}|([a-z0-9\-]{1,62}[a-z0-9]))\.)+(?:[a-z]{2,})$)$ |
| Description |
This regex matches FQDNs plus domains starting with an or containing asterisk. This is usefull for DNS configuration tools where you might have domains like *.domain.de or 12.152.80.in-addr.arpa. |
| Matches |
12.152.80.in-addr.arpa | *.domain.de | test.de |
| Non-Matches |
test | test. | -.de |
| Author |
Rating:
Not yet rated.
Andreas Burger
|
| Title |
Test
Details
Number
|
| Expression |
^\s*[+-]?\s*(?:\d{1,3}(?:(,?)\d{3})?(?:\1\d{3})*(\.\d*)?|\.\d+)\s*$ |
| Description |
Matches numbers. May include decimals, thousands separators, and sign. |
| Matches |
5,000 | - 10 | .1 |
| Non-Matches |
7.000.000 | 5,0000 | 1.000,000 |
| Author |
Rating:
mark
|
| Title |
Test
Details
AW Short Coordinate
|
| Expression |
^[0-9]+[NnSs] [0-9]+[WwEe]$ |
| Description |
This tests, are entered AW coordinates in correct short format, and it has no world info |
| Matches |
0N 0W |
| Non-Matches |
aw 0N 0W |
| Author |
Rating:
Slysoft
|
| Title |
Test
Details
Allow Decimal only
|
| Expression |
^\d*[0-9](|.\d*[0-9]|)*$ |
| Description |
Decimal like 123.23
123.1234
12345.456 |
| Matches |
123.23 | 123.1234 | 1234 | 1234.456 |
| Non-Matches |
123a.12 | 123.34d | abc |
| Author |
Rating:
Not yet rated.
Gyanendra
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(?s)( class=\w+(?=([^<]*>)))|(<!--\[if.*?<!\[endif\]-->)|(<!\[if !\w+\]>)|(<!\[endif\]>)|(<o:p>[^<]*</o:p>)|(<span[^>]*>)|(</span>)|(font-family:[^>]*[;'])|(font-size:[^>]*[;'])(?-s) |
| Description |
Word HTML cleanup code. Use this expression to get rid of most of the stuff that Word adds to an HTML document such as: lots of span elements, font-family and font-size style attributes, class attributes, a whole bunch of if-then statements. Use this expression in a regex.replace(originalHtml, regExpr, "").
|
| Matches |
<span> |
| Non-Matches |
<table> |
| Author |
Rating:
Peter Donker
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*.*))+\.((html|HTML)|(htm|HTM))$ |
| Description |
Path of files HTML and HTM |
| Matches |
c:\arquivo.html | \\home\arquivo232.HTML | Z:\teste.htm |
| Non-Matches |
c:\arquivo.png | arquivo232.HTML | Z:\teste |
| Author |
Rating:
Diego Siebra Ferreira
|
| Title |
Test
Details
Disallow certain characters
|
| Expression |
^[^'<>?%!\s]{1,20}$ |
| Description |
Disallow ' or < or > or ? or % or ! or space in a string. Minimum character is 1 and maximum is 20 in a string. |
| Matches |
abcd123 | --+abc |
| Non-Matches |
abc'123 | abc? | abc abc | <script> |
| Author |
Rating:
Bryian Tan
|
| Title |
Test
Details
Password with n numbers of digits, upper case character and special character.
|
| Expression |
(?=^.{12,25}$)(?=(?:.*?\d){2})(?=.*[a-z])(?=(?:.*?[A-Z]){2})(?=(?:.*?[!@#$%*()_+^&}{:;?.]){2})(?!.*\s)[0-9a-zA-Z!@#$%*()_+^&]*$ |
| Description |
User can specify n numbers of digits, upper case character and special character.
In this example, we will use two special characters, digits and upper case in the password.
Explanation:
(?=^.{12,25}$) -- password length range from 12 to 25
(?=(?:.*?[!@#$%*()_+^&}{:;?.]){2}) -- at least 2 special characters (!@#$%*()_+^&}{:;?.})
(?=(?:.*?\d){2}) -- at least 2 digits
(?=.*[a-z]) -- characters a-z
(?=.{2,}[A-Z]) -- at least 2 upper case characters
|
| Matches |
PassW0rd@1*3, pAsSword@#123 |
| Non-Matches |
PassW0rd@1*, PassW0rd@1*3', PassW0rd@1 3p |
| Author |
Rating:
Bryian Tan
|
| Title |
Test
Details
RegularExpression which does not allow SPACE
|
| Expression |
(?=^.{1,}$)(?!.*\s)[0-9a-zA-Z!@#$%*()_+^&\[\]]*$ |
| Description |
Regular Expression which does not allow SPACE but allows every possible alpha-numeric and special characters. |
| Matches |
abc*()A123 | 12xyz[_] |
| Non-Matches |
no space | abc *0123[] |
| Author |
Rating:
Bryian Tan
|
| Title |
Test
Details
Regular Expression to validate file path and extension
|
| Expression |
^(?:[\w]\:|\\)(\\[a-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx)$ |
| Description |
Regular Expression to validate file path and extension.Compatible with JavaScript and ASP.NET |
| Matches |
\\192.168.0.1\folder\file.pdf | \\192.168.0.1\my folder\folder.2\file.gif | c:\my folder\abc abc.docx | c:\my-folder\another_folder\abc.v2.docx |
| Non-Matches |
\\192.168.0.1\folder\fi/le.pdf | \\192.168.0.1\folder\\file.pdf | \\192.168.0.1\my folder\folder.2\.gif | c:\my folder\another_folder\.docx | c:\my folder\\another_folder\abc.docx | c:\my folder\another_folder\ab*c.v2.docx | c:\my?folder\another_folder\abc.v2.docx | file.xls |
| Author |
Rating:
Not yet rated.
Bryian Tan
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^(?=.*[0-9]+.*)(?=.*[a-zA-Z]+.*)[0-9a-zA-Z]{6,}$ |
| Description |
Password must contain at least one letter, at least one number, and be longer than six charaters. |
| Matches |
a1b2c3 | abcdefg123 | 12345a |
| Non-Matches |
abcdefghij | 1234567890 |
| Author |
Rating:
Eric Miller
|
Displaying page
of
pages;
Items to