Respect/Validation — pull request #107 by ramaciotti (2013-01-20 20:15:07+00:00)
Title: Rules based on ctype_

I've implemented new rules based on the ctype_ functions from PHP. I've also changed the existing rules Alpha, Alnum and Digits so they use their ctype_ equivalents.

The tests for the rules that already existed are all green, but I'm still somewhat afraid that it may break something in a corner case. The regex that was used and the ctype_ functions aren't semantically equivalent, and I had to make some validations besides calling the ctype_ function.

I've also included some tests for the new rules, although adding more lines to the data providers wouldn't be a bad idea.

Finally, I've studied the possibility of making Lowercase and Uppercase rules use their ctype_ equivalents, but I don't think it's worth the trouble. The current rules accept some strings that their equivalents don't (strings with spaces, punctuation, etc), and the current implementation is already pretty simple.