[Solved] How to use: Password regular expression for different validation [duplicate]


Resulting from the descussion, you need one regular expression for each check to perform.

  • At least 8 characters: ^.{8,}$
  • No whitespace character: ^\S*$
  • Both combined: ^\S{8,}$

Explanation:

  • ^ Start of the string
  • $ End of the string
  • . Any character (inclusive whitespace)
  • \S Any characters that is not whitespace
  • {8,} previous expression 8 or more times
  • * previous expression zero or more times

In order to develop, analyse and test regular expressions you can tools like this: https://regex101.com/

1

solved How to use: Password regular expression for different validation [duplicate]