ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Extractor

by bogdancstrike ST3 New

Extract emails, URLs, IPs, domains, dates, UUIDs, secrets — or any regex — from the current file into a new de-duplicated file. 22 built-in extractors, Command Palette + Tools menu, no dependencies.

Details

Installs

  • Total 0
  • Win 0
  • Mac 0
  • Linux 0
Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

🔎 Extractor

Pull every email, URL, IP, date, UUID, secret — or anything a regex can match — out of the current file and into a fresh, de-duplicated one.

Sublime Text Python Platform Dependencies


Logs, configs, dumps and docs are full of buried structure. Extractor scrapes it out in one command: choose what to pull, and it collects every match from the file (or your selection), removes duplicates, and opens the results in a new tab — ready to save, sort or paste elsewhere.

✨ Features

  • 🎯 22 built-in extractors — from emails to Luhn-checked credit-card numbers
  • 🧩 Custom regex — type any pattern; capture groups are honored
  • 🧹 De-duplicated output, optionally case-insensitive and/or sorted
  • ✂️ Whole file or selection — your choice, configurable
  • 🖱️ Everywhere — Command Palette, Tools menu, and right-click
  • 📦 Zero dependencies — pure Python standard library
  • 🐍 ST3 & ST4 — runs on both plugin hosts

🚀 Usage

  1. Open the Command Palette (Ctrl/Cmd + Shift + P).
  2. Run Extractor: Extract to new file….
  3. Pick what to extract. Done — the matches open in a new tab.

Prefer fewer clicks? Every extractor also has:

  • a direct Command Palette entry, e.g. Extractor: Emails
  • an item under Tools → Extractor

💡 By default Extractor reads the whole file, or just your selection when you have one. Change this under Preferences → Package Settings → Extractor → Settings.

Bind a key

Any extractor can be bound directly by passing its kind:

{ "keys": ["ctrl+alt+e"], "command": "extractor", "args": { "kind": "emails" } }

Omit args to open the picker.

🧰 What it can extract

Extractor Matches
Emails user@host.tld
URLs http, https, ftp and www. links
Domains Registrable root domains (example.co.uk)
Hostnames Fully-qualified host names and localhost
IPv4 addresses Dotted-quad addresses (192.168.0.1)
IPv6 addresses Colon-hex addresses (::1, fe80::…)
Ports Port numbers from host:port references
Phone numbers International / local numbers (heuristic)
Dates ISO, numeric and month-name dates
Times Clock times, optional seconds and AM/PM
Timestamps ISO 8601, syslog and Unix-epoch timestamps
File paths Unix, Windows and UNC paths
UUIDs RFC 4122 UUIDs / GUIDs
MAC addresses Ethernet hardware addresses
Hex colors #rgb and #rrggbb
Numbers Integers and decimals (thousands-aware)
Hashtags #hashtag
Mentions @handle
Credit cards 13–19 digit numbers that pass the Luhn check
Secrets & API keys AWS / Google / GitHub / Slack keys, JWTs, PEM private keys
Markdown links URLs inside [text](url)
Custom regex… Everything matching a pattern you type

📦 Installation

Package Control (recommended)

  1. Open the Command Palette and run Package Control: Install Package.
  2. Search for Extractor and press Enter.

Manual install

  1. In Sublime Text, open Preferences → Browse Packages….
  2. Create a folder named Extractor.
  3. Copy the contents of this repository into it.
  4. Restart Sublime Text, or run Tools → Developer → Reload Plugins.

⚙️ Settings

Preferences → Package Settings → Extractor → Settings

{
    "unique": true,                  // drop duplicate matches
    "case_insensitive_dedupe": true, // "Example.com" == "example.com"
    "sort": false,                   // keep first-seen order (true = sort A→Z)
    "source": "auto"                 // "auto" | "selection" | "file"
}

⚠️ Notes on accuracy

Extraction from free-form text is inherently heuristic. A few deliberate trade-offs:

  • Domains / hostnames are gated to a curated list of common TLDs, so main.py and README.md are not mistaken for hosts. Exotic TLDs are best captured with the Custom regex extractor.
  • Phone numbers require a + prefix or grouping separators; bare digit runs (which are indistinguishable from IDs or timestamps) are skipped.
  • File paths containing spaces are captured up to the first space.
  • Numbers is intentionally broad and will match digits inside IPs, dates, etc.

🤝 Contributing

Issues and pull requests are welcome — new extractors, better patterns, and test cases especially.

📄 License

Released under the MIT License.