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.
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.
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.
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.
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.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With