Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Username's regular expression in AWS Cognito [duplicate]

Tags:

aws-cognito

I'm using AWS Cognito for authenticating my application.As per the AWS Cognito guidelines, a proper username should follow the regular expression as follows [\p{L}\p{M}\p{S}\p{N}\p{P}]+ What does this regular expression mean?

like image 991
Vignesh S Avatar asked May 25 '17 11:05

Vignesh S


1 Answers

This expression allows almost any kind of character and must have at least 1 character to be inputted.

If you put this regular expression through regex101.com, it will tell you what each expression is used for.

So for your one:

\p{L} matches any kind of letter from any language.

\p{M} matches a character intended to be combined with another character (e.g. accents, umlauts, enclosing boxes, etc.)

\p{S} matches any math symbols, currency signs, dingbats, box-drawing characters, etc.

\p{N} matches any kind of numeric character in any script.

\p{P} matches any kind of punctuation character.

'+' Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed

like image 185
MinistryOfChaps Avatar answered Oct 23 '22 02:10

MinistryOfChaps