Just a note on validation, be wary when limiting the input in fields. There is nothing worse than wanting to punch a number in in a format that you use, only to have the stupid app beeping at you.
For example, I sometimes enter numbers with spaces to make it easier to read back (such as credit card numbers). Not to mention international numbers and the extra digits required for them, and the fact some people enter the "+", while others do not.
In many instances you want to allow certain input (such as spaces, brackets and pluses) and validate ignoring them, rather than limiting the input at the UI level.
As for actually doing it, there are a number of ways, from char-to-char parsing (reading one in at a time and making sure it what is expected) to RegEx to simply cleaning it and hoping for the best! There are plenty of resources that google can reveal on this.