PassportValidator constructor

PassportValidator()

validate the passport number.

The valid passport number of India must satisfy the following conditions:

  1. It should be eight characters long.
  2. The first character should be an upper case alphabet except Q, X, and Z.
  3. The next two characters should be a number, but the first character should be any number from 1-9 and the second character should be any number from 0-9.
  4. The next four characters should be any number from 0-9.
  5. The last character should be any number from 1-9.

see https://www.geeksforgeeks.org/how-to-validate-indian-passport-number-using-regular-expression/

Implementation

factory PassportValidator() {
  _instance ??= PassportValidator._();
  return _instance!;
}