Hi i have a field in php that will be validated in javascript using i.e for emails
var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
What i’m after is a validation check which will look for the
first letter as a capital Q
then the next letters can be numbers only
then followed by a .
then two numbers only
and then an optional letter
i.e Q100.11 or Q100.11a
I must admit i look at the above email validation check and i have no clue how it works but it does 😉
many thanks for any help on this
Steve
var regex = /^Q[0-9]+\.[0-9]{2}[a-z]?$/;+means one or morethe period must be escaped –
\.[0-9]{2}means 2 digits, same as\d{2}[a-z]?means 0 or 1 letterYou can check your regex at http://regexpal.com/