Can I use Reg Expression for the following use case?
I Need to write a boolean method which takes a String parameter that should satisfy following conditions.
- 20 character length string.
- First 9 characters will be a number
- Next 2 characters will be alphabets
- Next 2 characters will be a number.(1 to 31 or 99)
- Next 1 character will be an alphabet
- Last 6 characters will be a number.
In this, I have wrote the code for the first requirement: [a-zA-Z0-9]{20} - This expression works well for the first case. I don't know how to write a complete reg expression to meet the entire requirement. Please help.