91 regular expressions found in this category!
Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^\d{3}-\d{2}-\d{4}$ |
Description |
This regular expression will match a hyphen-separated Social Security Number (SSN) in the format NNN-NN-NNNN. |
Matches |
333-22-4444 | 123-45-6789 |
Non-Matches |
123456789 | SSN |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^[A-CEGHJ-PR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1}[0-9]{6}[A-DFM]{0,1}$ |
Description |
UK National Insurance Number (NINo) validation. The following modifications have been made: The first letter may not be D, F, I, Q, U or Z; the second letter may not be D, F, I, O, Q, U or Z; the final letter is optional. |
Matches |
JG103759A | AP019283D | ZX047829C |
Non-Matches |
DC135798A | FQ987654C | KL192845T |
Author |
Rating:
Chris Wicks
|
Title |
Test
Details
Current UK Vehicle Registration
|
Expression |
^([A-HK-PRSVWY][A-HJ-PR-Y])\s?([0][2-9]|[1-9][0-9])\s?[A-HJ-PR-Z]{3}$ |
Description |
UK vehicle registration system currently in use (as defined by the DVLA and put into effect from September 2001, and therefore does not allow registrations prior to this date). |
Matches |
AB51DVL | AB 51 DVL |
Non-Matches |
AZ01DLQ | AZ 01 DLQ |
Author |
Rating:
Amos Hurd
|
Title |
Test
Details
Pattern Title
|
Expression |
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,15})$ |
Description |
I built this expression to test a string in ASP for valid username and password constraints. It can be adapted for any number of scenerios. For instance in this case, we needed to ensure the username someone wanted was not all numbers or all letters and was 6-15 characters in length with no special characters. This expression tests negatively for all number cases, then all letter cases, and lastly tests for only alphanumeric characters in the required range. In other words: the match must be alphanumeric with at least one number, one letter, and be between 6-15 character in length. |
Matches |
C2dfeed | sporttrak1 | 11223a |
Non-Matches |
pookie | d34_fff | 123456 |
Author |
Rating:
Pete Lindquist
|
Title |
Test
Details
Pattern Title
|
Expression |
^((4\d{3})|(5[1-5]\d{2})|(6011))-?\d{4}-?\d{4}-?\d{4}|3[4,7]\d{13}$ |
Description |
Matches major credit cards including:
Visa (length 16, prefix 4), Mastercard (length 16, prefix 51-55), Discover (length 16, prefix 6011), American Express (length 15, prefix 34 or 37). All 16 digit formats accept optional hyphens (-) between each group of four digits. |
Matches |
6011-1111-1111-1111 | 5423-1111-1111-1111 | 341111111111111 |
Non-Matches |
4111-111-111-111 | 3411-1111-1111-111 | Visa |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?=[^\d_].*?\d)\w(\w|[!@#$%]){7,20} |
Description |
This regex can be used to restrict passwords to a length of 8 to 20 aplhanumeric characters and select special characters. The password also can not start with a digit, underscore or special character and must contain at least one digit. |
Matches |
password1 | pa$$word2 | pa!@#$%3 |
Non-Matches |
password | 1stpassword | $password# |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Social Security Number
|
Expression |
^(?!000)([0-6]\d{2}|7([0-6]\d|7[012]))([ -]?)(?!00)\d\d\3(?!0000)\d{4}$ |
Description |
This regex validates U.S. social security numbers, within the range of numbers that have been currently allocated. |
Matches |
078-05-1120 | 078 05 1120 | 078051120 |
Non-Matches |
987-65-4320 | 000-00-0000 | (555) 555-5555 |
Author |
Rating:
Michael Ash
|
Title |
Test
Details
Pattern Title
|
Expression |
\w{5,255} |
Description |
This is User Name & Password validation expression. It does not allow blank spaces as well as special characters like $#%@&*(){}+ |
Matches |
aa123_ter12 | aa4587 | 784566 |
Non-Matches |
123*-/ mksj |
Author |
Rating:
Chandan Agarwal
|
Title |
Test
Details
Pattern Title
|
Expression |
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}$ |
Description |
Password matching expression. Password must be at least 8 characters, no more than 15 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit. |
Matches |
aaaa1234AAAA | 12aaAA12 | aaaaa12345AAAAA |
Non-Matches |
aaaaa123456AAAAA | 12aaAA1 | 12aaaa12 |
Author |
Rating:
Jeff U
|
Title |
Test
Details
Pattern Title
|
Expression |
^([1-9]{1}(([0-9])?){2})+(,[0-9]{1}[0-9]{2})*$ |
Description |
Matchs comma delimited numbers. Easily changed to allow for other delimiters. (Edit ",")
Does not allow a leading 0
Does not allow groups of numbers with less than 3 numbers, exculding the first group. |
Matches |
123,123,123,123 | 100,120,000,010,011 | 1,123,123,123 |
Non-Matches |
012,123,123,123 | 12343,1244,4,12 | ,123,123,123 |
Author |
Rating:
Gregory Lyons
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z0-9]+$ |
Description |
it will check for alphanumeric (Alpha Numeric) values. |
Matches |
adad1213 | 1231dfadfa | dfad123dfasdfs |
Non-Matches |
dfa@#12313 | *(*sdfasdfadfd | $fffsdg121ddd#$f1q |
Author |
Rating:
himraj love
|
Title |
Test
Details
Pattern Title
|
Expression |
(?<FirstName>[A-Z]\.?\w*\-?[A-Z]?\w*)\s?(?<MiddleName>[A-Z]\w*|[A-Z]?\.?)\s?(?<LastName>[A-Z]\w*\-?[A-Z]?\w*)(?:,\s|)(?<Suffix>Jr\.|Sr\.|IV|III|II|) |
Description |
A regex that attempts to accurately parse the elements from a proper name where the format is in <<First, Last>> order or some permutation of that order. Critiques and suggestions for improvement are welcome. |
Matches |
David F Walker | J. S. Smith, Jr. | Catherine Zeta-Jones |
Non-Matches |
oscar peterson |
Author |
Rating:
David Walker
|
Title |
Test
Details
Pattern Title
|
Expression |
(^|\s)(00[1-9]|0[1-9]0|0[1-9][1-9]|[1-6]\d{2}|7[0-6]\d|77[0-2])(-?|[\. ])([1-9]0|0[1-9]|[1-9][1-9])\3(\d{3}[1-9]|[1-9]\d{3}|\d[1-9]\d{2}|\d{2}[1-9]\d)($|\s|[;:,!\.\?]) |
Description |
Incorporated other people's examples; removed extraneous parenthesis on 10/7/04. Currently the SSA site says 772 is the highest AREA number generated (http://www.ssa.gov/employer/highgroup.txt). Old expression was: (^|\s)\d{3}(-?|[\. ])\d{2}\2\d{4}($|\s|[;:,!\.\?]). Looks for either the beginning of a line or whitespace before the beginning of the social security number, then either zero or one hyphen OR one of a period or space, then uses the \3 to reference the value returned in the parenthesis that includes the -?|[\. ] (basically says if the first dash, period, or space is there, then the second one is required; and if the first dash, period, or space is not there, then the second one can't be either), and finally looks for the end of a line, whitespace, or punctuation characters after the social security number. |
Matches |
123-45-6789 | 123 45 6789 | 123456789 |
Non-Matches |
12345-67-890123 | 1234-56-7890 | 123-45-78901 |
Author |
Rating:
Dennis Flynn
|
Title |
Test
Details
Pattern Title
|
Expression |
(script)|(<)|(>)|(%3c)|(%3e)|(SELECT) |(UPDATE) |(INSERT) |(DELETE)|(GRANT) |(REVOKE)|(UNION)|(&lt;)|(&gt;) |
Description |
This Blacklist RegEx is designed to search a user input for any malicious code or SQL injection attempts. |
Matches |
http://www.domain.com/page.asp?param=</script> | https://www.domain.com/page.asp?param=;SELECT |
Non-Matches |
https://www.domain.com/page.asp?param=RealParam |
Author |
Rating:
Shahar Bracha
|
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-Z|a-z|&]{3}\d{2}((0[1-9]|1[012])(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])(29|30)|(0[13578]|1[02])31)|([02468][048]|[13579][26])0229)(\w{2})([A|a|0-9]{1})$|^([A-Z|a-z]{4}\d{2}((0[1-9]|1[012])(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])(29|30)|(0[13578]|1[02])31)|([02468][048]|[13579][26])0229)((\w{2})([A|a|0-9]{1})){0,3}$ |
Description |
Registro Federal de Contribuyentes (RFC) , used in Mexico as a unique set of caracters for a person or corporation registration .
Registro Federal de Contribuyentes utilizado en Mexico para el registro en hacienda. |
Matches |
ABCD790419 | ABC790419aa1 | ABCD790419AB1 |
Non-Matches |
AB790419 | A12790419 | ABC791332 |
Author |
Rating:
Leo Hinojosa
|
Title |
Test
Details
Pattern Title
|
Expression |
[v,V,(\\/)](\W|)[i,I,1,l,L](\W|)[a,A,@,(\/\\)](\W|)[g,G](\W|)[r,R](\W|)[a,A,@,(\/\\))] |
Description |
Spam trap
Catches many and many way to write viagra (replacing letters with similar chars, spacing chars with one space, etc). |
Matches |
Viagra | v1@G R /\ | \/iagr@ |
Non-Matches |
viaagra | vi agra | v1 gra |
Author |
Rating:
Sante Boscolo
|
Title |
Test
Details
Pattern Title
|
Expression |
^[\.\wæøå-]+@([a-zæøå0-9]+([\.-]{0,1}[a-zæøå0-9]+|[a-zæøå0-9]?))+\.[a-z]{2,6}$ |
Description |
Well it pretty much accepts all kinds of users, about the domain i didn't write it special for any TLD so there's no length defined, ohh and it accepts some IDN stuff |
Matches |
afdaas-ddas----asddas____...@asd.asd.asd.asd.asd.com | a@a.aa | .@microsoft.sun.apple.com |
Non-Matches |
aaaaaaa@.-com | aaaaaaa@adf.-com | aaaaaaa@ |
Author |
Rating:
Andreas Næsager
|
Title |
Test
Details
Pattern Title
|
Expression |
^([0-9a-fA-F]){8}$ |
Description |
Hex number/string validation method for the Electronic Serial Number(ESN) used in Cellular Phone products. |
Matches |
8ECCA04F | 82E5AAA4 | 82e5aaa4 |
Non-Matches |
8ECCAOF | 82E5AA4 | 82e5aaa45 |
Author |
Rating:
Cliff Wagner
|
Title |
Test
Details
Pattern Title
|
Expression |
^[{|\(]?[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}[\)|}]?$ |
Description |
Specifier Format of Guid Values that this RegEx supports: 32 digits: [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] 32 digits separated by hyphens: [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx] 32 digits separated by hyphens, enclosed in brackets: [{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}] 32 digits separated by hyphens, enclosed in parentheses: [(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] |
Matches |
914D226A-2F5B-4944-934D-96BBE6571977 | {914D226A-2F5B-4944-934D-96BBE6571977} |
Non-Matches |
914D226A-2F5B-4944-XXXX-96BBE6571977 | {914D226A-2F5B-4944-XXXX-96BBE6571977} |
Author |
Rating:
Nicholas Berardi
|
Displaying page
of
pages;
Items to