I do not know of any good prewritten/free scripts available on the web. Maybe some digging on google can produce some results. However, if you want to write your own... read below.
Are you just checking to see if the value is numeric and if the number's prefix is assigned to a specific card type? (that appears to be what the regex is doing). However, something more robust may be used if you implement validation using the Luhn formula (mod 10). Not sure about switch/solo but visa/mastercard/amex and most other credit card numbers can be checked in this fashion.
Luhn Formula -- http://www.webopedia.com/TERM/L/Luhn_formula.html
Also, it may be good to mention that before you pass the number to the above mentioned check it will be wise to check the length and make sure it is correct for the card type trying to be submitted.