Extract Emails, URLs and Numbers from Text
Pull the structured values out of prose or pasted logs — deduplicated, in order.
Why this is harder than one regular expression
Pattern matching is the easy part; deciding what counts is where extraction goes wrong. Consider the practical ambiguities: does example.com count as a URL when it has no scheme? Is 192.168.1.1 a host address or a version number? Does +1 555 0100 include the country code? Does an email written as name (at) domain (dot) com count — it does not match any pattern, and the person who wrote it deliberately obfuscated it.
| Target | Conservative rule used here | Excluded on purpose |
|---|---|---|
Local part, @, domain with a dot, valid TLD length | Anything with spaces, and bracketed obfuscations | |
| URL | http://, https:// or // with a host | Bare hostnames and email domains |
| Phone | A run of digits with optional +, spaces, dashes or parentheses | Short runs that look like dates or IDs |
| IPv4 | Four octets, each 0–255 | Anything with an octet above 255 |
Extraction is not validation
A string that matches the email pattern is not necessarily a deliverable or real address. Syntax and deliverability are different questions: a@b.co is syntactically valid, and admin@example.com is reserved by the IETF specifically for documentation and can never receive mail. If you need verified addresses, you need an SMTP or API check, not a pattern.
Where this is genuinely useful
- Pulling the contact addresses out of a long email thread before an import.
- Collecting every link from a changelog, a newsletter, or a page of documentation.
- Harvesting IP addresses out of an application log for a blocklist review.
- Extracting order or ticket numbers from pasted support text when the format is known.
- Checking that a document you are about to publish has no leftover staging URLs.
The consent and legality line
Extracting addresses from text you were given is ordinary office work. Extracting addresses by crawling the web and then sending unsolicited bulk mail is a different activity with different consequences: it is unlawful in the EU and UK without a lawful basis under the GDPR and PECR, and in the United States it conflicts with the CAN-SPAM Act's requirements around harvesting and misrepresentation. Scraping a site also means accepting its terms of service. The technical capability is neutral; what you do with the output is not.
Order, duplicates and copy-out
Output preserves the order of first appearance, which is usually what you want — it makes it easy to map a result back to the surrounding text. Duplicates are removed on an exact-match basis, so the same address appearing twelve times in a signature block appears once. For case-insensitive deduplication of addresses, fold to lowercase first using the case converter, because mail routing treats the domain as case-insensitive.
How to use it
- Paste the text or log.
- Select what to extract — emails, URLs, phone numbers or IPv4.
- Review the deduplicated list in order of first appearance.
- Copy the result and check count and sample before using it.
Worth knowing
example.comis reserved by the IETF for documentation and can never receive email.- Deduplication is exact-match, so case variants survive separately.
- Output preserves the order of first appearance in the source text.
- A syntax match says nothing about whether an address can receive mail.
Limitations
- Deliberately obfuscated addresses such as
name (at) domain (dot) comcannot be found. - Phone-number detection is deliberately loose and will miss unusual formatting.
- No validation of deliverability, DNS records or MX hosts.
- Extracting addresses by crawling other sites to send bulk mail is unlawful in many jurisdictions.
Frequently asked questions
Does it find obfuscated email addresses?
name (at) domain (dot) com do not match any address pattern, and guessing at them would produce false positives across ordinary prose.