How to use the Extract Text with Regular Expressions
- Paste your text in the Input box, drop a file on it, or click "Example" to try it.
- Adjust the options (preset, pattern, flags, capture group) to fit your needs.
- The output updates instantly as you type.
- 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.