Lurker News

Comments (129) 40 threads

Show all comments

Showing thread 27 of 40

Amarok1 reply#
^[a-z0-9_-]{3,15}$

The username reference doesn't match 16 characters as claimed

geongeorgek2 replies#
I should match. the number 15 there means that repeat x up to 15 times. so 1+15=16.

looks good to me

asicsp#
where does the extra 1 come from? a{2,5} means match 'a' two to five times
aratauto#
That is not correct. 15 is total maximum number of repeats including the first one. Even the diagram on https://ihateregex.io/expr/username correctly says that loop can be taken between 2 and 14 times.