Pattern extractor

Email addresses
2 matches
Source text402 chars
Unique matches
ada@example.com
grace@example.org
Matches in context2 shown

Contact ada@example.com or grace@example.org, call +1 (…

Contact ada@example.com or grace@example.org, call +1 (415) 555-0100. Docs l…

Also in this text15 patterns hit
Matches2
Unique2
Repeated0
Patterns hit15

Pattern Extractor

Pull every email address, URL, IP, UUID, date, price, or colour out of a block of text in one pass — twenty built-in patterns, or your own regular expression with capture groups. Results can be deduplicated, counted, and sorted, so a log dump becomes a list you can actually use.

Built-in patterns
20
Pass over the text
1
Checksum on card numbers
Luhn
Characters uploaded
0

Step by step

How to use it

  1. 01Paste the text

    A log file, an email thread, a page of HTML, a spreadsheet column — anything. Matching runs as you type and everything stays in your browser.

  2. 02Pick a pattern, or write one

    Emails, URLs, phone numbers, @mentions, hashtags, IPs, MAC addresses, UUIDs, numbers, currency amounts, dates, times, hex, RGB and HSL colours, gradients, ZIP codes, card numbers, HTML tags, and quoted strings. Or supply your own regular expression.

  3. 03Choose the capture group

    With a custom expression, group 0 is the whole match and 1 upwards are the parenthesised parts. Extracting just the domain from an email, or just the id from a URL, is a group selection rather than a second pass.

  4. 04Deduplicate, sort, and count

    Unique is on by default because most extractions are inventories rather than transcripts. Sort by frequency with counts shown to turn the result into a tally.

Worked example

Capture groups, or a second pass

The most useful thing a custom pattern gives you is not a different match — it is a different part of the same match. This is what the group selector is for.

Given

Input
a page of contact details
Pattern
custom
Question
which domains?

One expression, two useful answers

pattern   ([\w.+-]+)@([\w-]+\.[\w.]+)

group 0   ada@example.com        the whole match
group 1   ada                    the local part
group 2   example.com            the domain

unique + frequency on group 2
  -> example.com  14
     other.org     3
Passes needed
1
Groups available
0, 1, 2
Output
a domain tally

Asking which domains appear in a thread is normally extract-then-clean-then-count. With a group selection and frequency sorting it is one expression: the parentheses say which part you want, unique collapses the repeats, and the counts do the tally. The same trick pulls ids out of URLs, versions out of user agents, and error codes out of log lines.

Before you trust the matches

What to know about extracting patterns

A pattern is a shape, not a validation

The email pattern matches the local@domain.tld shape; it does not check that the mailbox exists, and it will happily match ada@example.invalid. Extraction tells you what looks like an address in this text — deliverability is a different question and a different tool.

Card numbers are checksum-verified, most patterns are not

The card pattern runs the Luhn algorithm, so a random 16-digit run is rejected. That is unusual: everywhere else a shape match is a shape match. It matters here because false positives on card numbers are the kind that get acted on.

Overlaps are resolved left to right

A regular expression scans forward and consumes what it matches, so overlapping candidates do not all appear — the earlier, longer match wins and the scan resumes after it. If something you can see is missing, check whether an earlier match swallowed it.

Deduplicating changes the question

Unique turns a transcript into an inventory: twelve mentions of one address become one row. That is right for building a contact list and wrong for measuring volume — turn on counts to get both at once rather than choosing.

Custom patterns run on your text, in your browser

Any expression you write is applied locally, so there is no limit to how specific it can be and no risk in pointing it at production data. A malformed expression is reported as an error rather than silently matching nothing.

Nothing is uploaded

The text people paste into an extractor is usually a log dump, an export, or a mailbox — full of exactly the identifiers that should not be sent anywhere to be counted. Matching runs entirely on your machine.

The judgement call

Built-in pattern, or your own?

The library covers the common shapes. These are the cases where a custom expression is the right answer.

  • Collecting addresses from a thread

    Email pattern

    The built-in shape plus unique gives a clean contact list in one pass.

  • Auditing a page for external links

    URL pattern

    Matches http, https, and ftp up to the first space. Add frequency sorting to see which domains dominate.

  • Pulling IDs out of log lines

    Custom + group

    Wrap the id portion in parentheses and select that group — no second cleaning pass.

  • Finding colours in a stylesheet

    Hex, RGB, or HSL

    Three separate patterns because stylesheets mix notations. Run each and combine the results.

  • Checking whether addresses are deliverable

    Wrong tool

    A pattern match is a shape check. Deliverability needs a mail server, not a regular expression.

  • Parsing HTML structure

    Use a parser

    The tag pattern finds tags; it cannot understand nesting. Regular expressions are the wrong shape for tree-structured data.

Reference

What the library covers

Contact
email · phone · @mentions · hashtagsPhone numbers match international and US-style formatting with optional separators.
Network
URL · IPv4 and IPv6 · MAC · UUIDIP matching covers dotted quads and full-length IPv6 addresses.
Values
numbers · currency · dates · times · ZIPDates cover ISO and US formats; currency covers $, €, £, and ¥ on either side of the amount.
Colour
hex · rgb() · hsl() · gradientsHex matching skips three- and six-digit strings that are actually hashtags, and vice versa.
Markup
HTML tags · quoted textQuoted text covers single, double, and curly quotes — useful for pulling strings out of source.
Card numbers
Luhn-validated13–19 digit runs that fail the checksum are discarded, which removes most false positives.

FAQ

Questions, answered plainly

How do I extract all email addresses from a text?

Paste the text and choose the email pattern. Every address in the local@domain.tld shape is listed, deduplicated by default. Turn on counts if you also want to know how often each one appeared, or sort by frequency to put the most common first.

Can I use my own regular expression?

Yes. Switch to a custom pattern and write any JavaScript-flavoured expression, with case sensitivity as a switch. If it contains capture groups you can select which group to extract, so pulling just the domain out of an address or just the id out of a URL is one pass rather than two.

What is a capture group and why would I select one?

The parenthesised parts of an expression. Group 0 is the whole match; group 1 upwards are the pieces you wrapped in parentheses. Selecting a group means you get exactly the part you wanted — the domain, the version number, the error code — without cleaning the results afterwards.

Why is a match missing?

Usually because an earlier match consumed it. Regular expressions scan left to right and do not return overlapping matches, so a longer match that started earlier wins and the scan resumes after it. Case sensitivity and a pattern that is narrower than you assumed are the other two common causes.

Does it check that what it finds is valid?

Only for card numbers, which are validated with the Luhn checksum so random digit runs are rejected. Everywhere else a match is a shape match: the email pattern finds things shaped like addresses, not addresses proven to exist.

Is my text uploaded?

No. Matching runs entirely in your browser, including any custom expression you write. That matters here more than most places, because the text people paste into an extractor is usually a log dump, an export, or a mailbox.

Matching runs entirely in your browser, custom expressions included. Nothing is uploaded, logged, or retained.