Sorry I know I've been asking loads of questions on this site, but I've just got a job doing web development and this is my first commercial experience.

I've been using regular expressions to validate form fields but I'm finding my code is getting too long to deal with. 4+ lines of code for each form field is excessive so I was wondering what the best way of doing form validation is? Is it best to make my own function with regualar expressions in to calculate things out, or should I use something else?