Regex Tester
Test regular expressions with live highlighting and match groups, get any pattern explained in plain English, and browse a cheatsheet of common patterns. Everything runs in your browser.
Flags come from the Tester tab (g, i, m, s). Explanations follow the JavaScript regex syntax.
How to use the Regex Tester
- Type a regular expression and choose flags (g, i, m, s, u).
- Paste test text; matches and capture groups highlight live.
- Check the match list and group values.
- Use the cheat sheet tab for syntax reminders.
Why use this Regex Tester
- Live JavaScript regular expression testing
- Highlights every match and capture group
- Flags for global, case-insensitive, multiline and dotAll
- Built-in regex cheat sheet
Related tools
A free RegExr alternative that explains your regex
If you are looking for a RegExr alternative, this tester runs entirely in your browser: no account, nothing uploaded, and it keeps working offline once loaded. Type a pattern and see matches highlighted live, with numbered and named capture groups listed for every match. Switch to the Explain tab to turn any pattern into plain English, piece by piece, with warnings for risky constructs.
What the explainer covers
- Everything in the JavaScript syntax: anchors, character classes and ranges, escapes such as
\d\w\s\b, Unicode escapes and\p{…}, quantifiers (greedy and lazy), alternation, capturing, named and non-capturing groups, backreferences, lookahead and lookbehind. - Warnings that save you time: nested quantifiers that can cause catastrophic backtracking (ReDoS), the
[A-z]range that also matches punctuation, greedy.*in the middle of a pattern, and lookbehind support in older browsers.
Which regex flavor is this?
The tester uses your browser's JavaScript (ECMAScript) engine, which is the right choice for front-end code, Node.js and TypeScript. PCRE, Python and .NET also support constructs that JavaScript does not, such as possessive quantifiers, atomic groups and inline flags, so a pattern that relies on them will not run here.
Frequently Asked Questions
Is the regex tester free?
Yes, completely free with no account or signup required.
Which regex flavor is used?
JavaScript's built-in RegExp (ECMAScript standard) with flags: global (g), case-insensitive (i), multiline (m), and dotAll (s).
What features are included?
Live match highlighting, capture group extraction, match count, a regex cheat sheet, and one-click patterns for common use cases.
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used to find, match, validate, and transform text in programming languages, editors, and command-line tools.
How do I test a regex online?
Enter your pattern in the Pattern field and your test string in the Text field. Matches are highlighted in real time as you type.
What are regex flags?
Flags modify how the pattern matches. g (global) finds all matches instead of stopping at the first. i (case-insensitive) treats uppercase and lowercase as equal. m (multiline) makes ^ and $ match line starts/ends. s (dotAll) makes . match newlines.
What is the difference between greedy and lazy quantifiers?
Greedy quantifiers (*, +, {n,m}) match as much as possible. Lazy quantifiers (*?, +?, {n,m}?) match as little as possible. For example, <.+> greedily matches a whole string, while <.+?> lazily matches the shortest possible span.
What is a capture group?
A capture group is part of the pattern wrapped in parentheses (). The matched text is extracted separately. Named groups use (?<name>...) syntax.
How do I match an email address with regex?
A common email pattern is [a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}. Click the Email pattern in the cheat sheet to use it instantly.
What is a lookahead in regex?
A lookahead asserts that a pattern must (or must not) follow the current position without consuming characters. (?=...) is a positive lookahead and (?!...) is a negative lookahead.
How do I match the start or end of a line?
Use ^ to match the start and $ to match the end. Enable the m flag to make ^ and $ match the start and end of each individual line rather than the whole string.
Is this a good RegExr alternative?
Brace's regex tester runs entirely in your browser with no sign-up: live match highlighting, capture and named groups, flags g, i, m and s, a cheatsheet of common patterns, shareable links, and an Explain tab that describes any pattern in plain English and warns about risky constructs such as catastrophic backtracking. It uses your browser's JavaScript (ECMAScript) regex engine, so features that exist only in PCRE, Python or .NET, such as possessive quantifiers and atomic groups, are not available.
How do I explain a regular expression in plain English?
Open the Explain tab, or click Explain in plain English under the pattern box. Each part of the pattern, such as groups, character classes, quantifiers, anchors and lookarounds, is listed with a short description and indented to show how groups nest. Warnings appear for common problems such as nested quantifiers and the [A-z] range mistake.
What is catastrophic backtracking?
Some patterns, such as (a+)+$, can take exponentially longer on certain inputs because the engine tries a huge number of ways to match, which can freeze a page or a server (ReDoS). Avoid nested quantifiers over the same characters, make alternatives mutually exclusive, and test with long non-matching strings. The Explain tab flags nested quantifiers.