Explanation on Credit Card Validation Script
<p>I would like to know the explanation for every character used for validating major credit card. I googled and found the following explanations but they're not quite explain it completely (e.g. what does <code>?:</code> mean? et al)</p>

<p>VISA = <code>^4[0-9]{12}(?:[0-9]{3})?$</code></p>

<p><em><strong>All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13.</em></strong></p>

<p>Mastercard = <code>^5[1-5][0-9]{14}$</code></p>

<p>All MasterCard numbers start with the numbers 51 through 55. All have 16 digits.</p>

<p>American Express = <code>^3[47][0-9]{13}$</code> </p>

<p><em><strong>American Express card numbers start with 34 or 37 and have 15 digits</em></strong></p>

<p>JCB = <code>^(?:2131|1800|35\d{3})\d{11}$</code></p>

<p><em><strong>JCB cards beginning with 2131 or 1800 have 15 digits. JCB cards beginning with 35 have 16 digits.</em></strong></p>

<p>Diners Club = <code>^3(?:0[0-5]|[68][0-9])[0-9]{11}$</code> </p>

<p><em><strong>Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. There are Diners Club cards that begin with 5 and have 16 digits. These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard.</em></strong></p>
