Lurker News

Comments (129) 40 threads

Earlier comments
Diti1 reply#
For the love of god, PLEASE DON’T USE REGEX TO VALIDATE EMAIL. The RegEx of this website ignores plus-addressing, for example. All you need to do to validate email is send a verification email.
xiconfjs#
not just the email regex is simplified (and at the end plain wrong). Also the one for phone numbers is highly simplified and will not match all valid phone numbers...
axegon1 reply#
This is awesome but.... I don't hate regex. Matter of fact, I love regex.
geongeorgek1 reply#
check out the ipv6 one :)
axegon#
I've had to write regex for deeply proprietary SQL-like (the word "like" is a big BIG stretch) language. This really is nothing. The regex itself was 4 pages long. AFAIK they still use it in production, almost 10 years later with 0 modifications.

¯\_(ツ)_/¯

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.

Load more comments