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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find 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
Source Sachin Bhatt
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: Checksum
Name: Alex
Date: 12/12/2011 4:36:09 PM
Comment:
If I'm not mistaken, this isn't a full vet. Credit cards use a checksum to ensure that random numbers aren't passed; this hearkens back to the days when the point of transaction was a completely separate process from validation, verification, and billing.


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