Back to Developer Tools

Regex Tester

Live regex testing with match highlighting. See matches, groups, and counts instantly.

/g
Flags:

Related Guide

Free Regex Tester Online: Test, Debug, and Learn Regular Expressions

Read Guide →

About This Tool

Free regex tester online — write and test JavaScript regular expressions with live match highlighting, group capture display, and full flag support (g, i, m, s, u). Your matches update as you type — no button press needed. Regular expressions (regex) are patterns used to search, extract, validate, and replace text. Developers use regex for form validation (email, phone, postal code patterns), log file parsing, find-and-replace in code editors, URL routing rules, and data extraction from API responses. This interactive regex tester shows every match highlighted in your test string, displays named and numbered capture groups, and lets you experiment with different flags to see their effect immediately. Much faster than a trial-and-error cycle in your code editor.

How to Use

  1. 1

    Enter your regex pattern

    Type your regular expression in the pattern field (without the surrounding /slashes/).

  2. 2

    Set flags

    Toggle flags: g (find all matches), i (case-insensitive), m (multiline), s (dotAll).

  3. 3

    Enter test text

    Paste or type the string you want to test against.

  4. 4

    See live matches

    Matches are highlighted in the test string in real time. Capture groups are listed below.

Frequently Asked Questions

What regex flavor does this use?+
JavaScript (ECMAScript) regex. If you are using regex in Python, PHP, or other languages, the syntax is very similar but some features differ (e.g., Python uses (?P<name>) for named groups, JS uses (?<name>)).
What does the g flag do?+
Without g, the regex stops at the first match. With g (global), it finds all matches in the test string. Always use g when you need to count or replace all occurrences.
How do I match special characters like . or *?+
Escape them with a backslash: \. matches a literal dot, \* matches a literal asterisk. Without the backslash, . matches any character and * is a quantifier.

Related Tools

Find & Replace

Try it free →

JSON Formatter

Try it free →

URL Encoder

Try it free →