passwordRegExp property

RegExp passwordRegExp
final

Regular expression pattern to validate passwords.

This pattern matches strings that represent a valid password with the following criteria:

  • At least one letter (uppercase or lowercase).
  • At least one digit.
  • Minimum length of 6 characters.

Example:

static final RegExp passwordRegExp = RegExp(r'^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,}$');
  • Matches: 'Password1', 'SecurePwd123', 'Abc123'
  • Does not match: 'password', '123456', 'ABCDEF'

Implementation

static final RegExp passwordRegExp =
    RegExp(r'^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,}$');