This will be a short tutorial on using REGEX to determine if a given credit card number fits the known creteria of how credit card numbers are issued.
All credit cards issued follow a certain number sequence that dictates what type of card they are. Each credit card type has a different set of numbers that can be used to determine if the user's input falls within a given set of rules that verify a certain level of authenticity. Numbers can fall within this ruleset and still not be a valid card however, this is just used to narrow the possibility of a wrong number being entered.