I just started with using Regular Expressions and I already found some good regex´ on the net, but I´d prefer to have my own version working.
I want to check that my AutoLoader only allows for class or interface names that consist of a-z, A-Z and 0-9 letters and that it begins with an uppercase letter.
Code:
if(preg_match("/^([A-Z]+[a-z0-9]*)([A-Z]*[a-z0-9]*)*/", $class, $name)) {
Leave a comment: