Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting credit card numbers in text

Tags:

c#

.net

I'm trying to find a component or a method which will detect credit card number of varying types in text.

I've found a lot of information on validating a credit card number but I need to be able to take a body of text e.g. a web page and check to see if credit card numbers, bank account numbers and or sort codes are present.

Does anyone know of a component that can help commerical or otherwise? Specifically my platform is .net c# but if anyone knows of solutions in other technologies it would be good to know those are there.

Thanks for your help.

like image 972
Richard Churchill Avatar asked Feb 05 '10 09:02

Richard Churchill


People also ask

How do you identify a credit card number?

A credit card number is the long set of digits displayed across the front or back of your plastic credit card. It is typically 16 digits in length, often appearing in sets of four, and it is used to identify both the credit card issuer and the account holder.

Is it possible to guess a credit card?

Guessing a valid credit card number is feasible. Choose a known BIN (first six), generate 9 random digits, and then append the appropriate checkdigit. That's only 1,000,000,000 combinations - high, but listing every single one is certainly doable even on a personal computer.

Can you write a regular expression matching a Visa credit card number?

Validating Credit Card Numbers on Your Order Form. Validating credit card numbers is the ideal job for regular expressions. They're just a sequence of 13 to 16 digits, with a few specific digits at the start that identify the card issuer.


1 Answers

This demands for a regular expression :)

Check this page http://www.regular-expressions.info/creditcard.html, especially the part "Finding Credit Card Numbers in Documents". (Though you'll probably find some false positives if looking for 16-digit-numbers.)

like image 82
Select0r Avatar answered Oct 02 '22 06:10

Select0r