New Perspectives on HTML and CSS, 7th Edition
Regular Expression Patterns
Tutorial 7
Case Problem 2
=============================================
Phone Number Regular Expression
^\d{10}$|^(\(\d{3}\)\s*)?\d{3}[\s-]?\d{4}$
ZIP Code
^\d{5}(-\d{4})?$
Credit Card Number Regular Expression
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$