How to write regular expression for 16 digit ID, rules mentioned below?

10

I have to write regular expression in informatica data quality for 16 digit ID which should follow below set of validation. ID Must have 16 characters and follow below rules-

  1. First 6 must be alphabetic characters
  2. Position 7 & 8 are numeric digits
  3. Position 9 alphabetic character
  4. Position 10 &11 are numeric digits
  5. Position 12 alphabetic character
  6. Position 13-15 are numeric digits
  7. Position 16 alphabetic character

I have tried with many ways , not working as expected.Can anyone please help me here.

answered question

1 Answer

5

You may try:

^[A-Za-z]{6}[0-9]{2}[A-Za-z][0-9]{2}[A-Za-z][0-9]{3}[A-Za-z]$

Note that if the alphabetic characters would be only exlcusively uppercase or lowercase, then you may replace the chracter class [A-Za-z] with either just [A-Z] or [a-z].

posted this

Have an answer?

JD

Please login first before posting an answer.