First up, I’m a N00b with Regex it’s like a new language that I’m struggling with ATM and looking for some direction.
I have a form that has a serial number field but the fields contents can be one of 3 possible rules.
Rule1 : Length is always 13 Position 1 is always C Positions 2-5 is
numeric Position 6 is alpha Position 7-13 is numericRule2 : Length is 8 or 9 Position 1-2 is alpha Position 3-8 is numeric
Postion 9 is alphaRule3 : Length is 9 Position 1-9 is numeric
My question: is this of formula achievable inside regex – and sub question: Pointers for where I can look to or expressions I can decipher ?
Apologies if this is too n00b’esque – RegEx does my head in 🙂
Have a try with:
I suppose that the last alpha is optional in the rule #2
explanation: