Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^[0,1]?\d{1}\/(([0-2]?\d{1})|([3][0,1]{1}))\/(([1]{1}[9]{1}[9]{1}\d{1})|([2-9]{1}\d{3}))$ |
Description |
This expression checks the validity of a date (US, but it is easily editable for other format's). Year's 1990-9999, Month's 1 or 01 to 12, Day's 1 or 01 to 31. Still needs to have individual months added (i.e., Feb's 28 days), and some how to check for leap year...the months issue should not be to hard, but the leap year seems like a real chore. Please let me know if you have any suggestions for leap year.
|
Matches |
01/01/1990 | 12/12/9999 | 3/28/2001 |
Non-Matches |
3-8-01 | 13/32/1001 | 03/32/1989 |
Author |
Rating:
Scott Watermasysk
|
Title |
Test
Details
Pattern Title
|
Expression |
^.+@[^\.].*\.[a-z]{2,}$ |
Description |
Most email validation regexps are outdated and ignore the fact that domain names can contain any foreign character these days, as well as the fact that anything before @ is acceptable. The only roman alphabet restriction is in the TLD, which for a long time has been more than 2 or 3 chars (.museum, .aero, .info). The only dot restriction is that . cannot be placed directly after @.
This pattern captures any valid, reallife email adress. |
Matches |
|
Non-Matches |
|
Author |
Rating:
Thor Larholm
|
Title |
Test
Details
Pattern Title
|
Expression |
^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$ |
Description |
It verifies that: - Only letters, numbers and email acceptable symbols (+, _, -, .) are allowed - No two different symbols may follow each other - Cannot begin with a symbol - Ending domain must be at least 2 letters - Supports subdomains - TLD must be between 2 and 6 letters (Ex: .ca, .museum) - Only (-) and (.) symbols are allowed in domain, but not consecutively.
Problems:
See comments below |
Matches |
|
Non-Matches |
|
Author |
Rating:
Gavin Sharp
|
Title |
Test
Details
Pattern Title
|
Expression |
^([a-zA-Z0-9!@#$%^&*()-_=+;:'"|~`<>?/{}]{1,5})$ |
Description |
This Regular expression validates a string that contains all printable characters with a minimum length of 1 and maximum length of 5.
Obviously the min and max can be changed to meet the users needs.
^([a-zA-Z0-9!@#$%^&*()-_=+;:'"|~`<>?/{}]{1,5})$ This is the string, I keep getting &amp;lt and other characters when I save it. |
Matches |
ilove | $%*!_ | it |
Non-Matches |
123456 | This is great |
Author |
Rating:
Not yet rated.
Michael Matusiewicz
|
Title |
Test
Details
Pattern Title
|
Expression |
^((Bob)|(John)|(Mary)).*$(?<!White) |
Description |
"Starts with but does not end with."
I needed a pattern to require certain first (and optional middle) names, but to fail for certain last names. So if Bob, John, and Mary are acceptable first names but the White's are always rejected then...
|
Matches |
Bob Jones | John Smith | Mary Jane Smith |
Non-Matches |
Bob White | Mary Doe White | Gina Smith |
Author |
Rating:
Not yet rated.
Eli Robillard
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$ |
Description |
US Phone Number: This regular expression for US phone numbers conforms to NANP A-digit and D-digit requirments (ANN-DNN-NNNN). Area Codes 001-199 are not permitted; Central Office Codes 001-199 are not permitted. Format validation accepts 10-digits without delimiters, optional parens on area code, and optional spaces or dashes between area code, central office code and station code. Acceptable formats include 2225551212, 222 555 1212, 222-555-1212, (222) 555 1212, (222) 555-1212, etc. You can add/remove formatting options to meet your needs. |
Matches |
5305551212 | (530) 555-1212 | 530-555-1212 |
Non-Matches |
0010011212 | 1991991212 | 123) not-good |
Author |
Rating:
Don Johnston
|
Title |
Test
Details
Pattern Title
|
Expression |
^([A-Za-z0-9]\s?)+([,]\s?([A-Za-z0-9]\s?)+)*$ |
Description |
This regular expression can be used to parse a comma delimited string. Leading whitespaces (at the beginning of the entire string) and ending commas are not acceptable. Any combination of letters and numbers with zero or one white space between them are acceptable. Note: To change the delimiter, simply replace the comma in the square brackets to the delimiter of choice. |
Matches |
123, 4567, 8901 | abc, defghi, jklmn | abc123 |
Non-Matches |
abc123 | abc123, | ,abc123 |
Author |
Rating:
Rehan Azam
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z]+((\s|\-)[a-zA-Z]+)?$ |
Description |
This regex validates a persons first name. Acceptable names include compound names with a hyphen or a space in them. |
Matches |
Bobbie Sue | Ana-Claire | BobbyJoe |
Non-Matches |
Billy - Joe | Billy Jr. | Thos. |
Author |
Rating:
Not yet rated.
s l
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z]+((((\-)|(\s))[a-zA-Z]+)?(,(\s)?(((j|J)|(s|S))(r|R)(\.)?|II|III|IV))?)?$ |
Description |
This regex validates a persons last name. Acceptable names can include compound names seperated by a hyphen or a space. |
Matches |
Jones, Jr | Casey-Jones | Casey-Jones, IV |
Non-Matches |
Jones, IV. | Jones , Jr | Casey-Jones-Hall |
Author |
Rating:
Not yet rated.
s l
|
Title |
Test
Details
Pattern Title
|
Expression |
^(19[0-9]{2}|[2-9][0-9]{3})-((0(1|3|5|7|8)|10|12)-(0[1-9]|1[0-9]|2[0-9]|3[0-1])|(0(4|6|9)|11)-(0[1-9]|1[0-9]|2[0-9]|30)|(02)-(0[1-9]|1[0-9]|2[0-9]))\x20(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$ |
Description |
Checks for the format yyyy-MM-dd HH:mm:ss
also known as SortableDateTimePattern (conforms to ISO 8601) using local time. From 1900-01-01 00:00:00 to 9999-12-31 23:59:59. No check for leap year. |
Matches |
2004-07-12 14:25:59 | 1900-01-01 00:00:00 | 9999-12-31 23:59:59 |
Non-Matches |
04-07-12 14:25:59 | 20004-07-12 14:25 | 2004/07/12 14:25:59 |
Author |
Rating:
Jens Ulrik Jacobsen
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z_]{1}[a-zA-Z0-9_@$#]*$ |
Description |
This Regex matches valid SQL identifiers, including names for Stored Procedures and the like. Note that local variables/parameters (which begin with an "@") will not match this Regex, nor will temporary objects (beginning with a "#"), or global temporary objects (beginning with "##"). All other valid identifiers/variables/table names/stored procedure names/columns etc., will match. Please let me know if you find this useful or have any complaints - [email protected]. |
Matches |
upApplicationReadContacts | _Application_ReadContacts | a_45$#z |
Non-Matches |
upApplication ReadContacts | $Application_ReadContacts | a_45%$#z |
Author |
Rating:
Geoff Williams
|
Title |
Test
Details
Pattern Title
|
Expression |
<\s*a\s[^>]*\bhref\s*=\s*
('(?<url>[^']*)'|""(?<url>[^""]*)""|(?<url>\S*))[^>]*>
(?<body>(.|\s)*?)<\s*/a\s*> |
Description |
Suitable for extraction of all hyperlinks in the format:
<a ... href="..." ...> some text </a>
from a text document. Separates in groups the components of the links (url and body). |
Matches |
<a href="javascript:'window.close()'">close the window</a> | <a target=&quo |
Non-Matches |
<aa href="test.htm">test</a> | < a href hr = 'http://www.nakov.com'>...& |
Author |
Rating:
Svetlin Nakov
|
Title |
Test
Details
Pattern Title
|
Expression |
&\#x0*(0|1|2|3|4|5|6|7|8|B|C|E|F|10|11|12|13|14|15|16|17|18|19|1A|1B|1C|1D|1E|1F); |
Description |
Can be used to match on (and strip out) low-order non-printable ASCII characters (ASCII 0-31) from string data prior to adding to an XML document. Useful when using parsers like Microsoft's MSXML3 that strictly enforce W3C specification on allowable characters. Does not match on ASCII 9 (horiz tab), 10 (carriage return), 13 (line feed). |
Matches |
&#x2; | &#x001F; |
Non-Matches |
&#x0020; | &#xDFFF; |
Author |
Rating:
Not yet rated.
Matt Skone
|
Title |
Test
Details
Pattern Title
|
Expression |
(.*\.jpe?g|.*\.JPE?G) |
Description |
I just couldn't find any simple expression to check if an entered value is a jp(e)g.
If you're using this to check for e.g. mp3, just use the following:
(.*\mp3|.*\.MP3)
This expression is not really stable, cause it will also match file.jpg.mp3 or stuff like that. |
Matches |
*.JPG | *.jpeg |
Non-Matches |
.gif |
Author |
Rating:
N Verlaan
|
Title |
Test
Details
Pattern Title
|
Expression |
<table>(<tr>((<td>([A-Za-z0-9])*</td>)+)</tr>)*</table> |
Description |
This accepts html's tables, with rows and colums.
Acepta tablas Html, con sus respectivas filas y columnas. |
Matches |
<table><tr><td>Hello</td></tr></table> | <table></table |
Non-Matches |
<table><tr></tr> |
Author |
Rating:
Not yet rated.
Isaac Triguero Velázquez
|
Title |
Test
Details
URL Test
|
Expression |
(?#WebOrIP)((?#protocol)((http|https):\/\/)?(?#subDomain)(([a-zA-Z0-9]+\.(?#domain)[a-zA-Z0-9\-]+(?#TLD)(\.[a-zA-Z]+){1,2})|(?#IPAddress)((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])))+(?#Port)(:[1-9][0-9]*)?)+(?#Path)((\/((?#dirOrFileName)[a-zA-Z0-9_\-\%\~\+]+)?)*)?(?#extension)(\.([a-zA-Z0-9_]+))?(?#parameters)(\?([a-zA-Z0-9_\-]+\=[a-z-A-Z0-9_\-\%\~\+]+)?(?#additionalParameters)(\&([a-zA-Z0-9_\-]+\=[a-z-A-Z0-9_\-\%\~\+]+)?)*)? |
Description |
I needed a regex for validating URLs, couldn't find a suitable one, so wrote this, with comments! It matches any valid web URL (Address or IP, with or without protocol), including optional port number, directory path, filname.extension and any paramater pairs. Hope it helps, even if just to understand expressions easier! |
Matches |
www.test.com|http://www.test.com|234.232.12.23:8080|sub.test.com/dir/file.ext?param=val¶m2=val2 |
Non-Matches |
/file.htm|256.0.0.0 |
Author |
Rating:
David Barker
|
Title |
Test
Details
Chemical Elements symbols
|
Expression |
^((?-i)A[cglmrstu]|B[aehikr]?|C[adeflmorsu]?|D[bsy]|E[rsu]|F[emf]?|G[ade]|H[efgos]?|I[nk]?|Kr?|L[airu]|M[dgnot]|N[abdeiop]|Os?|P[abdmortu]?|R[abefghnu]|S[bcegimnr]?|T[abcehil]|U(u[bhopqst])?|V|W|Xe|Yb?|Z[nr])$ |
Description |
Chemical elements of the periodic table from 1 to 118. |
Matches |
Hg |
Non-Matches |
HE |
Author |
Rating:
Not yet rated.
Guy Bruneau
|
Title |
Test
Details
IP Tables
|
Expression |
^(?<Date>.+\s\d+\s\d+\:\d+\:\d+).+\:.+\:(?<Traffic>.+)\:(?<Rule>.+)\:IN\=(?<InboundInterface>.+)\sOUT\=(?<OutboundIntercace>.*?)\s(?:MAC\=(?<MacAddress>.+)\s|)SRC\=(?<Source>.+)\sDST\=(?<Destination>.+)\sLEN\=.+TOS\=.+PROTO\=(?<Protocol>.+)\sSPT\=(?<SourcePort>.+)\sDPT\=(?<DestinationPort>.+)\s.+$ |
Description |
The goal of my regular expression is to allow me to break apart IP Table log files so that I can build a basic web front-end to allow me to view the traffic on the network. The MAC address is optional, because the way that this firewall works, is by providing the MAC address when the outbound address is not available. |
Matches |
Jul 20 13:05:08 123.123.123.123 kernel: Shorewall:loc2net:REJECT:IN=eth0 OUT=eth1 SRC=444.333.222.111 DST=111.222.333.444 LEN=59 TOS=0x00 PREC=0x00 TTL=127 ID=12267 PROTO=UDP SPT=2121 DPT=53 LEN=39 |
Non-Matches |
Anything Else |
Author |
Rating:
Sean McIlvenna
|
Title |
Test
Details
A Forgiving US Phone Number
|
Expression |
^(1?)(-| ?)(\()?([0-9]{3})(\)|-| |\)-|\) )?([0-9]{3})(-| )?([0-9]{4}|[0-9]{4})$ |
Description |
This is a fairly forgiving phone number match. It's original purpose was to extract phone numbers from the details field in our database and into their own phone number table. It worked brilliantly. Enjoy! |
Matches |
14165551212, 4165551212, (416)5551212, 416 555 1212, 416-555-1212, (416)-555-1212, (416) 555 1212, 1-900-888-1212 |
Non-Matches |
456-444-45464, 416-SEX-POOP, 4!6-777-#232 |
Author |
Rating:
Doug Jones
|
Title |
Test
Details
Private IP address
|
Expression |
(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|(^127\.0\.0\.1) |
Description |
It matches private IP addresses. Private IP addresses (as defined by RFC 1918) are not routable on public Internet. This would help if you want to grant some previlege only to the users from within local network. ***Importnat*** This pattern assumes that the input is a valid IP address. You many need to make sure the input is a valid IP address. |
Matches |
10.12.0.19 | 172.21.0.23 | 192.168.0.2 |
Non-Matches |
222.12.3.24 | 172.12.0.12 |
Author |
Rating:
Not yet rated.
Mahesh Ramakrishnan
|
Displaying page
of
pages;
Items to