Extract Text with Regular Expressions

Extract every match of a regular expression (or a capture group) from text. Includes presets for URLs, emails, sitemap links and more. 🔒 Runs in your browser

Output

How to use the Extract Text with Regular Expressions

  1. Paste your text in the Input box, drop a file on it, or click "Example" to try it.
  2. Adjust the options (preset, pattern, flags, capture group) to fit your needs.
  3. The output updates instantly as you type.
  4. Click Copy or Download. Use "Use as input" to chain another operation.

About this tool

Extract every match of a regular expression (or a capture group) from text. Includes presets for URLs, emails, sitemap links and more. It is part of the free Extractors collection on Online Tools Harbor. Everything happens locally in your browser, so it is fast and private.

Frequently asked questions

How do I extract URLs from a sitemap?

Paste the sitemap XML and choose the "Sitemap <loc> URLs" preset, or use the dedicated Sitemap URL Extractor, which can also fetch a sitemap from its URL.

Which regex flavour is used?

JavaScript regular expressions. Flags: g (global), i (ignore case), m (multiline), s (dot matches new lines), u (unicode).

Is the Extract Text with Regular Expressions free?

Yes. The Extract Text with Regular Expressions is completely free to use, with no sign-up and no limits on normal use.

Is my data safe?

Yes. This tool runs entirely in your web browser using JavaScript. Your text is never uploaded to our servers.

Is there a size limit?

There is no fixed limit: it depends on your device. Several megabytes of text are processed in a fraction of a second on most computers.

Does it work on mobile?

Yes, it works in any modern browser on phones, tablets and computers. No app to install.

Related tools

Email ExtractorExtract all email addresses from text, HTML or CSV, with duplicates removed.Email List Validator & CleanerNewCheck a list of email addresses for valid syntax, fix common typos (gmial.com) and split valid from invalid.Extract Domains from EmailsGet the list of domains from a list of email addresses, with counts.URL ExtractorExtract every link (http/https URL) from text or HTML. Optionally keep only domains.Number ExtractorExtract all numbers (integers, decimals, negatives) from text.Phone Number ExtractorFind and extract phone numbers from text in common international formats.Hashtag & Mention ExtractorExtract #hashtags and @mentions from social media posts.IP Address ExtractorExtract IPv4 and IPv6 addresses from logs and text.Extract Text Between Two StringsExtract every piece of text found between a start and end marker.