I'm trying to create a class which validates parameters passed into a function, only primitive values though. I've so far done integer, boolean and float. However with my string function, I also want to be able to pass in a parameters about allowed character sets. Like:
- Allowed upper case
- Allowed lower case
- Allowed numbers
- Allowed special characters
However, I can't figure out how to test this. I've tried doing it with regex, but my best trials aren't working too well.
Any nudge in the right direction would be a great help.
Please note, I'm using an old version for PHP - 5.1.2