Regular expression includes latin characters

I have a regex to ensure that the password has upper and lower case characters and is limited to a few characters:

^(?:(?=[^a-z]*[a-z])(?=[^A-Z]*[A-Z])(?=.*[$@$!%*?&,;.:-_])[A-Za-z\d$@$!%*?&,;.:-_]+)?$

NOTE: it allows an empty password. I check it in a different way.

However, this does not allow the use of Latin characters, such as ç, á, õ, etc.

How to add this type of character?

UPDATE

I am trying to create a regex check to check passwords that is synchronized with Microsoft settings, for example:

RequireDigit (Default = true) 
  Requires a number between 0-9 in the password.

RequireNonAlphanumeric (Default = true)     
  Requires a non-alphanumeric character in the password.

RequireUppercase (Default = true)   
  Requires an upper case character in the password.

RequireLowercase (Default = true)   
  Requires a lower case character in the password.

RequiredUniqueChars (Default = 1)   
  Requires the number of distinct characters in the password

Microsoft Documentation: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-configuration?tabs=aspnetcore2x

, , , .

?

+4
1

, , , , . , , , , - (, , , ..) , . , , , , ( / script) 8 .

, , , . @maccettura, , . , [A-Za-z\d$@$!%*?&,;.:-_], , , , . 75 . 75 ? 8 , 680,240,886,192,000 (, , ). ?

. StackExchange :

:

. regex

^(?=\P{Ll}*\p{Ll})(?=\P{Lu}*\p{Lu})(?=\P{N}*\p{N})(?=.*[^\p{‌​L}\p{N}\p{C}]).{8,}$

\p{x} Unicode , x

  • ^
  • (?=\P{Ll}*\p{Ll}) script
  • (?=\P{Lu}*\p{Lu}) , , script
  • (?=\P{N}*\p{N}) script
  • (?=.*[^\p{‌​L}\p{N}\p{C}]) , , .
  • .{8,} , 8 ( )
  • $
+3

Source: https://habr.com/ru/post/1692055/


All Articles