Regex Tester

Free online regex tester. Write JavaScript regular expressions and see live highlighted matches, capture groups, flags and a replace preview — instant, no signup.

Test and debug regular expressions live with highlighted matches, capture groups, a replace preview, flag toggles and ready-made patterns for email, URL, IP and more.

Share
Category
Developer Tools
Includes
6 features
Access
Free · No sign-up
Privacy
Runs in your browser
Regex Tester

Loading Regex Tester......

Please wait a moment

How to use

How to use Regex Tester

  1. 01

    Enter a pattern

    Type a regex or pick a preset like Email or URL.

  2. 02

    Toggle flags

    Click g, i, m, s, u or y to change matching behaviour.

  3. 03

    Add a test string

    Paste text and watch matches highlight live.

  4. 04

    Replace or copy

    Preview a replacement or copy the finished /pattern/flags.

Use cases

Common use cases

  • Validate an email or URL pattern before shipping it
  • Debug why a regex isn't matching your data
  • Extract capture groups from log lines
  • Craft a find-and-replace with group references
Overview

See exactly what your regex matches

Regular expressions are hard to debug in your head. This tester runs your JavaScript regex against a test string and highlights every match in place, counts them, and lists each match's index and capture groups. Toggle flags like global, case-insensitive and multiline with a click, and get instant, readable feedback the moment your pattern changes.

Build, replace and reuse

Start from a preset for common patterns — email, URL, IPv4, hex colour, phone or date — then adapt it to your data. The replace panel previews the result of a substitution with $1, $2 group references, so you can craft find-and-replace rules with confidence. A quick cheatsheet keeps the syntax handy, and everything runs in your browser so your test data stays private.

Features
01
Live match highlighting as you type
02
All flags: g, i, m, s, u, y
03
Capture-group and match-index breakdown
04
Replace preview with $1 group substitution
05
Preset patterns: email, URL, IPv4, hex, phone
06
Built-in cheatsheet, runs 100% locally
FAQ

Frequently asked questions

What regex flavour does this tester use?+

It uses the JavaScript (ECMAScript) regular expression engine, the same one that runs in browsers and Node.js, including flags g, i, m, s, u and y.

Can I test capture groups?+

Yes. Every match lists its index and the value of each capture group, so you can confirm your groups pull out exactly the right substrings.

How does the replace preview work?+

Type a replacement string using $1, $2 to reference capture groups (or $& for the whole match) and the tool shows the replaced text live.

Is my test data private?+

Yes. The regex runs entirely in your browser — your patterns and test strings are never uploaded.