858
you are viewing a single comment's thread
view the rest of the comments
[-] NegativeLookBehind@lemmy.world 80 points 5 days ago* (last edited 5 days ago)

I found your email address:

(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
[-] exu@feditown.com 16 points 5 days ago

I was about to ruin your day by finding a valid email address that would be rejected by your regex, but it doesn't even parse correctly on regex101.com

The only valid regex for email is .+@.+ btw

[-] IAmVeraGoodAtThis 5 points 5 days ago

What about "user@not_domain"? It validates but isn't valid - there's no domain part, the @ is quoted

[-] exu@feditown.com 4 points 5 days ago

That's not something you can determine using a regex.

"user@com" for example could be a perfectly working email.

The right way is to send a verification email in every case.

load more comments (8 replies)
load more comments (9 replies)
this post was submitted on 14 Feb 2025
858 points (100.0% liked)

Programmer Humor

20652 readers
1365 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS