RegEx to make sure that the string contains at least one lower case char, upper case char, digit and symbol

后端 未结 3 1252
悲哀的现实
悲哀的现实 2020-11-22 16:06

What is the regex to make sure that a given string contains at least one character from each of the following categories.

  • Lowercase character
  • Upperca
3条回答
  •  清歌不尽
    2020-11-22 16:41

    You can match those three groups separately, and make sure that they all present. Also, [^\w] seems a bit too broad, but if that's what you want you might want to replace it with \W.

提交回复
热议问题