Is anyone using a working Credit Card number validator with Symfony 1.4?
I found https://gist.github.com/181049 via http://brentertainment.com/2009/09/01/some-helpful-symfony-form-validators/ but at least the switch regex pattern appears to be definitely broken, and probably jcb / enroute as well.
I think the problem is that it's using square brackets instead of parentheses where it's trying to match the prefixes, but if that's broken then it leads me to doubt the rest of the validator.
/^[4903|4911|4936|5641|6333|6759|6334|6767]\d{12}$/
should be
/^(4903|4911|4936|5641|6333|6759|6334|6767)\d{12}$/
Does anyone have a working, tested validator they're using in production? Preferably with UK cards?