Regex Tester
Test regular expressions against sample text with live highlighting, match tables, capture groups and replacement preview, all in your browser.
What the regex tester does
Type a pattern, pick flags, and paste the text you want to match. Every match is highlighted as you type, listed in a table with its position and capture groups, and you can enter a replacement string to preview the result of a search and replace. Invalid patterns show a clear error instead of failing silently. Presets for emails, URLs, IPv4 addresses, dates, phone numbers and hex colors give you a starting point.
Flags explained
- g global: find every match rather than stopping at the first.
- i ignore case: treat A and a the same.
- m multiline: make ^ and $ match at line boundaries.
- s dotAll: let . match newline characters.
- u unicode: handle emoji and non-Latin scripts correctly.
Practical uses
Validate form input before it reaches your server, clean up spreadsheets exported from an old system, write redirect rules for a site migration, or extract product codes from supplier feeds. Because everything runs in your browser using the JavaScript engine, the behavior matches what you will see in front-end code and in Node. PHP and Python share most of the syntax with a few differences in lookbehind and named groups. For cleaning text rather than matching it, the slug generator and word counter may be quicker.
Frequently asked questions
Why does my pattern match only once?
What is a capture group?
Is my text uploaded?
Why is my email pattern rejecting valid addresses?
We build the sites and systems these tools measure.
Digzy Technology designs fast, search-friendly websites, stores and apps. Tell us what you have in mind.