RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 48 regular expressions found.

Change page:   |    Displaying page 1 of 3 pages; Items 1 to 20
Title Test Details Pattern Title
Expression
\d{4}-?\d{4}-?\d{4}-?\d{4}
Description
Major credit card validator. Only checks that the format is 16 digits (optionally separated by hyphens), not the value of any of the digits.
Matches
1234-1234-1234-1234 | 1234123412341234
Non-Matches
1234123412345
Author Rating: The rating for this expression. Steven Smith
Title Test Details Pattern Title
Expression
^(\d{4}[- ]){3}\d{4}|\d{16}$
Description
Credit card validator. Just checks that the format is either 16 numbers in groups of four separated by a "-" or a " " or nothing at all.
Matches
1234-1234-1234-1234 | 1234 1234 1234 1234 | 1234123412341234
Non-Matches
Visa | 1234 | 123-1234-12345
Author Rating: Not yet rated. Steven Smith
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: The rating for this expression. Steven Smith
Title Test Details Pattern Title
Expression
(^(4|5)\d{3}-?\d{4}-?\d{4}-?\d{4}|(4|5)\d{15})|(^(6011)-?\d{4}-?\d{4}-?\d{4}|(6011)-?\d{12})|(^((3\d{3}))-\d{6}-\d{5}|^((3\d{14})))
Description
This provides an expression to calidate the four major credit cards. It can be easily broken up to use for a specific type of card. It does not validate the number being a potential real number, only in the correct format.
Matches
4111-1234-1234-1234 | 6011123412341234 | 3711-123456-12345
Non-Matches
1234567890123456 | 4111-123-1234-1234 | 412-1234-1234-1234
Author Rating: The rating for this expression. Chris Love
Title Test Details Pattern Title
Expression
^((?:4\d{3})|(?:5[1-5]\d{2})|(?:6011)|(?:3[68]\d{2})|(?:30[012345]\d))[ -]?(\d{4})[ -]?(\d{4})[ -]?(\d{4}|3[4,7]\d{13})$
Description
This just a minor mod to Steven Smith's credit card re to accept spaces as separators, as well as return the four parts of the card. [Updated Oct-18-2002 to work with Diners Club/Carte Blanche (prefix must be 36, 38, or 300-305)]
Matches
6011567812345678 | 6011 5678 1234 5678 | 6011-5678-1234-5678
Non-Matches
1234567890123456
Author Rating: The rating for this expression. Glenn Carr
Title Test Details Pattern Title
Expression
^((0[1-9])|(1[0-2]))\/(\d{2})$
Description
Validates MM/YY for rough checking credit card expiration dates.
Matches
11/03 | 01/04
Non-Matches
13/03 | 10/2003
Author Rating: The rating for this expression. Kevin Coleman
Title Test Details Pattern Title
Expression
^((4\d{3})|(5[1-5]\d{2}))(-?|\040?)(\d{4}(-?|\040?)){3}|^(3[4,7]\d{2})(-?|\040?)\d{6}(-?|\040?)\d{5}
Description
Credit card validator for AMEX, VISA, MasterCard only. Allows spaces, dashes, or no separator between digit groups according to the layout (4-6-5 for AMEX, 4-4-4-4 for Visa and Mastercard)
Matches
3711-078176-01234 | 4123 5123 6123 7123 | 5123412361237123
Non-Matches
3711-4123-5123-6112
Author Rating: Not yet rated. Rick Spiewak
Title Test Details Pattern Title
Expression
(\d{6}[-\s]?\d{12})|(\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4})
Description
Credit card validator Works for switch card numbers too Switch card bit is (\d{6}[-\s]?\d{12}) Credit card bit is (\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}) I use this as a client side test before running a more comprehensive server side check.
Matches
5111 1111 1111 11118 | 1234123412341324 | 123456 123456789012
Non-Matches
511a 1111 1111 11118
Author Rating: Not yet rated. Joe Gass
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: The rating for this expression. Sachin Bhatt
Title Test Details Pattern Title
Expression
^(?:(?<Visa>4\d{3})|(?<Mastercard>5[1-5]\d{2})|(?<Discover>6011)|(?<DinersClub>(?:3[68]\d{2})|(?:30[0-5]\d))|(?<AmericanExpress>3[47]\d{2}))([ -]?)(?(DinersClub)(?:\d{6}\1\d{4})|(?(AmericanExpress)(?:\d{6}\1\d{5})|(?:\d{4}\1\d{4}\1\d{4})))$
Description
Updated on 7 Jun 2005 -- Matches major credit cards including: Visa (length 16, prefix 4); Mastercard (length 16, prefix 51-55); Diners Club/Carte Blanche (length 14, prefix 36, 38, or 300-305); Discover (length 16, prefix 6011); American Express (length 15, prefix 34 or 37). Saves the card type as a named group to facilitate further validation against a &quot;card type&quot; checkbox in a program. All 16 digit formats are grouped 4-4-4-4 with an optional hyphen or space between each group of 4 digits. The American Express format is grouped 4-6-5 with an optional hyphen or space between each group of digits. Formatting characters must be consistant, i.e. if two groups are separated by a hyphen, all groups must be separated by a hyphen for a match to occur.
Matches
4111-2222-3333-4444 | 3411 222222 33333 | 5111222233334444
Non-Matches
4111-2222-3333-444 | 3411-2222-3333-4444 | Visa
Author Rating: Not yet rated. Jerry Schmersahl
Title Test Details Pattern Title
Expression
^([0-9]{3,4})$
Description
Allows you to check the length of a number (in this case either 3 or 4 digits). I found it useful when validating Credit Card Identification Codes (CVV2/CVC2/CID) which are either 3 or 4 numerical digits.
Matches
123 | 1234
Non-Matches
12 | 12345
Author Rating: The rating for this expression. Patrick Timmons
Title Test Details Pattern Title
Expression
^((67\d{2})|(4\d{3})|(5[1-5]\d{2})|(6011))-?\s?\d{4}-?\s?\d{4}-?\s?\d{4}|3[4,7]\d{13}$
Description
Credit Card Matching - Matches Switch, Solo, Visa, MasterCard and Discover. Matches length and valid prefix. Accepts input optional spaces and dashes between number groups
Matches
5154-1234-1234-1342 | 4444333322221111 | 6767 1111 1111 1111
Non-Matches
1234123412341234 | 1111111 | 987654321
Author Rating: The rating for this expression. hazel ryan
Title Test Details Pattern Title
Expression
^((67\d{2})|(4\d{3})|(5[1-5]\d{2})|(6011))(-?\s?\d{4}){3}|(3[4,7])\d{2}-?\s?\d{6}-?\s?\d{5}$
Description
Credit Card Validation. Matches Switch/Solo, Visa, MasterCard and Discover in 4-4-4-4/4 4 4 4/4444 format and Amex in 4-6-5/4 6 5/465 format. Includes checks for prefixes, (67 for switch/solo, 4 for visa, 51-55 for MasterCard, 37/34 for Amex and 6011 for Discover. Matches all major UK debit and credit cards with spaces dashes or as a continous number
Matches
4234 1234 1234 1234 | 5434123412341234 | 3712 123456 12345
Non-Matches
1234123412341234 | 1111111 | 987654321
Author Rating: The rating for this expression. hazel ryan
Title Test Details Pattern Title
Expression
^[a-z\.]*\s?([a-z\-\']+\s)+[a-z\-\']+$
Description
Matches Names - written for credit card matching. Optional Prefix that can contain a fullstop, one or more forenames that can contain hyphens and apostrophes followed by a surname that can contain hyphens and apostrophes
Matches
Miss H Ryan | Miss Ryan | Miss Hazel Joanne Ryan
Non-Matches
Hazel | Hazel Ryan
Author Rating: The rating for this expression. hazel ryan
Title Test Details Pattern Title
Expression
^5[1-5][0-9]{14}$ # First character is 5 # Second character is 1-5 # Last 14 characters 0-9
Description
Validates Mastercard credit card
Matches
5125632154125412 | 5225632154125412 | 5525632154125412
Non-Matches
5625632154125412 | 4825632154125412 | 1599999999999999
Author Rating: Not yet rated. Ben Parish
Title Test Details Pattern Title
Expression
^3(?:[47]\d([ -]?)\d{4}(?:\1\d{4}){2}|0[0-5]\d{11}|[68]\d{12})$|^4(?:\d\d\d)?([ -]?)\d{4}(?:\2\d{4}){2}$|^6011([ -]?)\d{4}(?:\3\d{4}){2}$|^5[1-5]\d\d([ -]?)\d{4}(?:\4\d{4}){2}$|^2014\d{11}$|^2149\d{11}$|^2131\d{11}$|^1800\d{11}$|^3\d{15}$
Description
For credit card numbers from MC, Visa, Amex, Diners/CarteBlanche, Discover/Novus, Enroute, and JCB. Does as much as I feel is possible using regex (doesn't do MOD 10). Javascript safe.
Matches
341-1111-1111-1111 | 5431-1111-1111-1111 | 30569309025904
Non-Matches
30-5693-0902-5904 | 5631-1111-1111-1111 | 31169309025904
Author Rating: The rating for this expression. David Conorozzo
Title Test Details Visa Credit Card
Expression
(^4\d{12}$)|(^4[0-8]\d{14}$)|(^(49)[^013]\d{13}$)|(^(49030)[0-1]\d{10}$)|(^(49033)[0-4]\d{10}$)|(^(49110)[^12]\d{10}$)|(^(49117)[0-3]\d{10}$)|(^(49118)[^0-2]\d{10}$)|(^(493)[^6]\d{12}$)
Description
Matches Visa CC types 13 or 16 digits starting with 4 including Visa CC, Visa ATM only, Visa Electron and Visa Delta. Safe for international and will NOT match "^(49)" Switch debit cards.
Matches
4111111111111111
Non-Matches
4903020000000008
Author Rating: Not yet rated. brad
Title Test Details Maestro Credit Card
Expression
(^(5[0678])\d{11,18}$) |(^(6[^0357])\d{11,18}$) |(^(601)[^1]\d{9,16}$) |(^(6011)\d{9,11}$) |(^(6011)\d{13,16}$) |(^(65)\d{11,13}$) |(^(65)\d{15,18}$) |(^(633)[^34](\d{9,16}$)) |(^(6333)[0-4](\d{8,10}$)) |(^(6333)[0-4](\d{12}$)) |(^(6333)[0-4](\d{15}$)) |(^(6333)[5-9](\d{8,10}$)) |(^(6333)[5-9](\d{12}$)) |(^(6333)[5-9](\d{15}$)) |(^(6334)[0-4](\d{8,10}$)) |(^(6334)[0-4](\d{12}$)) |(^(6334)[0-4](\d{15}$)) |(^(67)[^(59)](\d{9,16}$)) |(^(6759)](\d{9,11}$)) |(^(6759)](\d{13}$)) |(^(6759)](\d{16}$)) |(^(67)[^(67)](\d{9,16}$)) |(^(6767)](\d{9,11}$)) |(^(6767)](\d{13}$)) |(^(6767)](\d{16}$))
Description
Meastro ONLY card matching - begins with "50" or "56-58" or "6" & 13 to 20 total digits. Overlap of Discover, Solo and Switch is handled and NOT matched.
Matches
5600000000000003
Non-Matches
6011000000000004
Author Rating: The rating for this expression. brad
Title Test Details MasterCard Credit Card
Expression
^5[1-5]\d{14}$
Description
Matches MasterCard credit cards. International safe, no overlap with other cards.
Matches
5100000000000008
Non-Matches
201400000000009
Author Rating: Not yet rated. brad
Title Test Details Discover Credit Card
Expression
(^(6011)\d{12}$)|(^(65)\d{14}$)
Description
Discover Credit Card matching. International safe, no overlap
Matches
6011000000000004
Non-Matches
4508750000000009
Author Rating: Not yet rated. brad
Change page:   |    Displaying page 1 of 3 pages; Items 1 to 20

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