Problems / Validate Email Format / Editorial
^[^@\s]+@[^@\s]+\.[^@\s]+$
[^@\s]+
@
[^@\s]+\.[^@\s]+$
missing@dotcom
user@.com
trailing@dot.
regexp_matches(email, pattern)
F.col('email').rlike(pattern)
You never need to *count* the @ signs: because both character classes exclude @, any second occurrence (as in two@ats@example.com) has nowhere to match and the whole pattern fails. The other classic trap is anchoring — regexp_matches and rlike search for the pattern anywhere in the string, so without ^...$ an invalid address containing a valid-looking substring would slip through.
two@ats@example.com
regexp_matches
rlike
^...$
Solve Validate Email Format yourself →