ToolWren logo ToolWren
ToolWrenText › Regex Tester

Regex Tester

Write a regular expression and test it against sample text in real time. See every match, its position and any capture groups instantly.

100% client-side · nothing is uploaded

Loading tool…

Quick answer

Regex Tester is a free, private online tool that lets you test a regular expression against sample text with live matches, flags and capture groups. It runs entirely in your browser, so nothing you enter is uploaded to a server.

How to use the Regex Tester

  1. Enter your regular expression and any flags (like g or i); or pick a ready-made one from Common patterns.
  2. Paste your test text — matches are highlighted and listed with capture groups as you type.
  3. Switch to Replace or Split mode to preview substitutions or splitting.
  4. Use the built-in cheat sheet below for a quick syntax reference.

Privacy: this tool runs entirely in your browser. Your input is never sent to, received by, or stored on any server — there are no uploads and no tracking of what you enter.

About Regex Tester

Testing regular expressions

Enter a pattern and flags, then paste text to test. Matches are listed as you type, including the matched substring, its index and the contents of each capture group.

Flags

Use flags like g (global, find all matches), i (case-insensitive), m (multiline) and s (dotall). This tool uses the JavaScript regex engine.

Capture groups

Parentheses create capture groups. The tester shows each group's value per match, which is invaluable for extracting structured data from text.

Frequently asked questions

Which regex flavour is this?
JavaScript (ECMAScript) regular expressions, the same engine used in browsers and Node.js.
Does it support named groups?
Yes — named groups work, and their captured values appear alongside numbered groups.
Is my text uploaded?
No. Matching runs entirely in your browser.

Understanding Regex Tester in depth

What a regex tester does

A regex (regular expression) tester lets you build and check a pattern against sample text and see the matches highlighted live as you type. Regular expressions are a compact, powerful mini-language for finding, validating, extracting and replacing text patterns, and a tester is the fastest way to get one right without trial-and-error in code.

What regular expressions are for

A regex describes a pattern rather than a fixed string - 'one or more digits', 'an email-shaped token', 'a word at the start of a line'. They power search-and-replace, form validation (emails, phone numbers, postcodes), log parsing, data extraction and find-in-files across virtually every programming language and text editor.

Match, replace and split modes

This tester offers three modes. Match lists every match with its position and capture groups. Replace previews a substitution using replacement patterns like $1 for captured groups. Split shows the pieces you get when the text is broken apart on the pattern. Together they cover the three things you most often do with a regex.

Flags, groups and the cheat sheet

Flags change behaviour - g finds all matches, i ignores case, m works line-by-line, s lets the dot match newlines. Capture groups in parentheses pull out parts of each match. The built-in common-patterns library and cheat sheet give you tested starting points (email, URL, IPv4, date, hex color) and a quick syntax reference.

Privacy and how to use it

Enter your pattern and flags, paste test text, and matches appear instantly; switch modes to test replacing or splitting. It uses the JavaScript regex engine - the same one in browsers and Node.js. Everything runs locally, so you can safely test patterns against real, sensitive data without it leaving your browser.

Related & complementary tools

More Text tools