Skip to content
Butter Tools Logo
Butter Tools

Regex Tester

Test regular expressions live with real-time match highlighting, capture group details and replace mode.

Pattern
/ /
Quick patterns:
Test string
Match highlights
Matches will be highlighted here…
Match list
No matches yet…
menu_book

How to Use Regex Tester

To test a regular expression, enter your regex pattern in the pattern field and paste the text you want to search in the test area below. Matches are highlighted in the text in real time as you type. You can set flags such as g (global), i (case-insensitive), and m (multiline) using the flag toggles.

The match panel below the text area lists every match found, along with its position and any captured groups. You can also use the Replace tab to perform a find-and-replace operation using your regex pattern and a replacement string, then copy the resulting text. This is useful for developers validating input patterns, parsing text, or batch-editing content.

help

Frequently Asked Questions

What regex flavour does this tester use? expand_more

The tester uses JavaScript's built-in RegExp engine, which follows the ECMAScript regex specification. Patterns work the same way as in JavaScript code.

What does the global flag (g) do? expand_more

The global flag makes the regex find all matches in the text rather than stopping after the first. Without it, only the first match is returned.

How do I match a literal dot or other special character? expand_more

Special regex characters like ., *, +, and ? must be escaped with a backslash to match literally. For example, use \. to match an actual period rather than any character.

What are capture groups in a regex? expand_more

Capture groups are portions of a pattern enclosed in parentheses, such as (\d+). They capture the matched text for that sub-pattern separately, making it available in the match details and usable in replacement strings as $1, $2, etc.

Can I use this to test email or URL validation patterns? expand_more

Yes. Paste your validation regex and a sample of email addresses or URLs into the test area to see which ones match. This is a common use for confirming that validation patterns work correctly before adding them to code.