Regular expressions and text guides

Extract emails and URLs: candidates are not verified addresses

Use extraction for discovery, trim context carefully, and validate candidates according to the consuming application.

Nav Tools ·

Define candidate extraction

Extraction finds strings resembling an address or URL inside larger text. It does not prove deliverability, reachability or ownership.

Use a log excerpt with known positive and negative examples. Decide whether punctuation belongs to surrounding prose or to the candidate itself.

Contact: ada@example.com
Docs: https://example.com/guide?q=one

Validate after extraction

An email syntax check has a defined scope and cannot verify that a mailbox exists. International addresses and quoted local parts need explicit support decisions.

Nav Tools’ email validator uses its documented practical format. A result rejected by that rule is not automatically invalid under every email protocol.

Parse URLs structurally

A URL parser separates scheme, host, path and query. A syntactically valid URL can still point to an unavailable or unwanted destination.

Allow only required schemes and apply destination policy before fetching. A regex match alone cannot implement a safe server-side request policy.

Keep useful provenance

Deduplicate only when repeated occurrences are irrelevant; logs may need every occurrence and its location. Keep the original text for review.

Compare extracted counts with a small hand-reviewed fixture, then process the larger input. Do not auto-request every extracted URL merely to check it.

References

← Regular expressions and text guides