Skip to content

Commit c1cfb1e

Browse files
loisaidasamziishaned
authored andcommitted
Username update (ziishaned#39)
As pointed out by @jdp - `\d` and `_` are a subset of `\w`. Maybe worth mentioning that most places don't allow usernames to start with a number, underscore, or dot. Even more generally speaking, these are nice toy/model illustrations, but maybe it's worth pointing out that while fun for practice, maybe regex isn't the best way to validate some of these things.
1 parent e390ba3 commit c1cfb1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ line. And because of `m` flag now regular expression engine matches pattern at t
474474
* *US Phone Number*: `^+?[\d\s]{3,}$`
475475
* *US Phone with code*: `^+?[\d\s]+(?[\d\s]{10,}$`
476476
* *Integers*: `^-?\d+$`
477-
* *Username*: `^[\w\d_.]{4,16}$`
477+
* *Username*: `^[\w.]{4,16}$`
478478
* *Alpha-numeric characters*: `^[a-zA-Z0-9]*$`
479479
* *Alpha-numeric characters with spaces*: `^[a-zA-Z0-9 ]*$`
480480
* *Password*: `^(?=^.{6,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$`

0 commit comments

Comments
 (0)