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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find 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
Source Modified from existing expressions in this library
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: false positive
Name: Rob Eberhardt
Date: 1/20/2004 6:39:19 AM
Comment:
6011123412341234567890abcdefghijklmnopqrstuvwxyz


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