3 ms·
Actually, both A and B are incorrect choices. Option A is a complete waste of time. Option B uses a regex that is no longer standards compliant and will tell
by horsawlarway 8y ago
Actually, both A and B are incorrect choices. Option A is a complete waste of time. Option B uses a regex that is no longer standards compliant and will tell users that their entirely valid email address is invalid (this is usually a no-no...).
You're skipping entirely over option C:
c) Send the user an email asking them to validate their email.
You'll notice option C is actually the preferred method of almost every company that needs your email to be valid. Option C also does not use a regex at all.