Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Username update
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.
  • Loading branch information
loisaidasam authored Aug 10, 2017
commit bcf5c5e8e7e67d57509a293d29bdebf2ecd4ca0d
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ line. And because of `m` flag now regular expression engine matches pattern at t
* *US Phone Number*: `^+?[\d\s]{3,}$`
* *US Phone with code*: `^+?[\d\s]+(?[\d\s]{10,}$`
* *Integers*: `^-?\d+$`
* *Username*: `^[\w\d_.]{4,16}$`
* *Username*: `^[\w.]{4,16}$`
* *Alpha-numeric characters*: `^[a-zA-Z0-9]*$`
* *Alpha-numeric characters with spaces*: `^[a-zA-Z0-9 ]*$`
* *Password*: `^(?=^.{6,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*$`
Expand Down