What counts as an email address here#
The pattern used matches the realistic shape of an email address: a local part that can include letters, digits, and the common special characters like ., + and - (which covers plus-addressing, like [email protected]), an @, and a domain made of valid labels separated by dots — which also correctly matches multi-level domains like mail.example.co.uk. It intentionally does not implement the full, notoriously permissive RFC 5322 grammar (which technically allows quoted strings and other rarely-used syntax); it matches the email addresses people actually write and receive.
Why trailing punctuation does not get swept in#
A sentence ending in an email address — "reach out to [email protected]." — has a period immediately after the address that is sentence punctuation, not part of the domain. The pattern requires a valid domain label to follow every dot, so a period with nothing (or a space) after it is correctly excluded from the match instead of producing a mangled [email protected]. in the results.
What "finding" an email does not tell you#
This extracts text that has the shape of a valid email address — it does not verify the address exists, that the domain accepts mail, or that the mailbox is active. A syntactically perfect address can still bounce. For a proper existence check, an actual verification service that performs an SMTP handshake or a real deliverability API is the right tool; this one only finds what looks like an address in text.