Regular Expression Validation control

liunx

Guest
I'm new to regular expression validator controls and I want to create a validation expression so that a user can only enter a string that contains between 6 and 20 characters of lower case letters, [a-z]{6,20} with optional hyphen, underscore or numbers 0-9 BUT must contain at least 1 letter. How do I do that?

Any help greatly appreciated.I think it will be much easier doing it hard-coded, using string functions. It shouldn't more than a few lines of code. Let me know if you don't succeed.I've looked at a few regex library sites - phew - very complicated and a programtic approach seems very sensisble indeed.

Stuff like:

^([a-z]|[0-9])([a-z]|[0-9]|([a-z]|[0-9]|(%|&|'|\+|\-|@|_|\.)[^%&'\+\-@_\.]|\.$|([%&'\+\-@_\.]\ [^\ ]|\ [%&'\+\-@_\.][^%&'\+\-@_\.])))+$


No thanks, life's just a bit short for that kind of headache

Thanks
 
Back
Top