When it comes to validating input regular expression becomes a very important part of your security plan.  On a side note ensure your regular expressions are doing Acceptance-List approach and not a Deny-List approach to validation as mentioned in a previous blog. 

Those use to writing a lot scripts have a very good understanding of regualar expressions and their are many others that find it challenging.  I have discovered a twelve parts blog by Eric Lippert of Microsoft on the theory behind regular expression.  For those that like to learn the theory behind regular expressions I highly recommend reading this.  For those learning regular expression it may help to under the theory behind what you are learning.