Free Regex Tester Online

Test regular expressions against sample text with real-time matching, groups, and explanation.

Last updated
//
Contact us at hello@example.com or support@flexypdf.com for help.
#1hello@example.comat index 14
Group 1: helloGroup 2: example.com
#2support@flexypdf.comat index 35
Group 1: supportGroup 2: flexypdf.com

You can stare at a regular expression for ten minutes and still not be sure why it does not match. Our free online Regex Tester replaces that frustrating guess-and-check loop with a tight feedback cycle: type the pattern, type the test text, and every match lights up in real time as you edit either side. Capture groups are colour-coded, and a side panel lists each match with its index, position, and captured group values so you can see exactly what your pattern is doing — and exactly what it is missing. Backreferences, named groups, lookaheads, lookbehinds, character classes, quantifiers (greedy, lazy, possessive where supported), and the full flag set (`g` for global, `i` for case-insensitive, `m` for multi-line, `s` for dotall, `u` for Unicode, `y` for sticky) all work as they would in a real JavaScript runtime — because behind the scenes the tester evaluates your pattern with the browser's native `RegExp` engine, which is the same engine your code will use in production. That fidelity matters: you do not want to debug a regex against a different flavour and then watch it fail when you paste it into your actual codebase. Real-world scenarios where this saves time: validating an email or phone format and discovering it falsely rejects valid edge cases; writing a Markdown link extractor and checking it against a paragraph with both inline and reference-style links; building a log parser that needs to capture timestamps, severity levels, and message bodies into separate groups; pulling structured data out of HTML when a real parser is overkill; testing a search-and-replace operation before running it across thousands of files; and learning regex as a beginner by watching what each character class actually matches in plain English. The match panel shows the captured groups inline, so you can confirm that group 1 really is the username and group 2 really is the domain before pasting the pattern into your code. Quick craft note: regex flavours differ. JavaScript, PCRE (used by PHP, Perl, and many command-line tools), Python, .NET, and POSIX all have small but real differences. This tester uses the JavaScript flavour, which is what you want when targeting browser code, Node.js, TypeScript, React, or any modern web stack. For server-side or shell work, double-check the equivalent syntax in your target language's docs. If you need to format the surrounding code your regex will live inside, the [Code Beautifier](/tools/code-beautifier) handles JavaScript and other languages, and for testing the data your regex will run against, the [JSON Formatter](/tools/json-formatter) helps when that data is structured. Everything happens in your browser — no signup, no patterns logged, no daily limit.

How to Use Regex Tester

1

Enter Your Pattern

Type the regex pattern into the pattern box. You do not need to wrap it in slashes — the flags are set separately.

2

Pick Flags

Toggle the flag checkboxes — `g` for all matches, `i` for case-insensitive, `m` for multi-line, `s` for dotall, `u` for Unicode.

3

Paste Test Text

Drop your sample input into the test text area. Matches are highlighted as you type, and the match panel updates in real time.

4

Inspect Capture Groups

The match panel lists each match with its position and the captured groups. Hover over a highlight to see the group breakdown inline.

Features

Native JavaScript Engine

Uses the browser's built-in RegExp implementation — exactly the same engine that your production JavaScript will use.

Real-Time Highlighting

Matches and capture groups are colour-coded and updated on every keystroke. No "test" button to press.

Full Flag Set

g, i, m, s, u, and y are all supported. Toggle them independently and watch the match results change.

Capture Group Inspector

See each match with its position, the full match string, and the value of every numbered and named capture group.

Lookaheads and Lookbehinds

Both positive and negative lookaheads (`(?=...)`, `(?!...)`) and lookbehinds (`(?<=...)`, `(?<!...)`) work as in modern JavaScript.

Benefits of Using Regex Tester

Completely Free

Use Regex Tester without any cost, limits, or hidden fees. No premium plans needed.

No Installation

Works directly in your browser. No software downloads or plugins required.

100% Private

Your files and data are processed locally. Nothing is uploaded to external servers.

Works Everywhere

Compatible with Chrome, Firefox, Safari, Edge on desktop, tablet, and mobile.

No Sign-Up

Start using the tool immediately. No account creation or email verification.

Always Available

Access this tool 24/7 from anywhere in the world, on any device.

Frequently Asked Questions

JavaScript / ECMAScript regex, evaluated with the browser's native RegExp object. That makes it accurate for any code targeting Node.js, browsers, or any modern web framework. PCRE, Python, .NET, and POSIX flavours have minor differences — double-check those if your code runs there.
Almost always one of three causes: the flags are different (a missing `g` is a classic), the input text contains a hidden character (a non-breaking space, a Windows line ending, a BOM), or the language flavour differs. The tester shows exact character positions, which usually exposes the hidden-character case immediately.
Yes — `(?<name>pattern)` works and the named groups appear in the match panel alongside the numbered groups. Named groups are part of standard ECMAScript and supported in every evergreen browser.
The current page focuses on match and capture inspection. For an interactive replace preview, paste the pattern and template into the [Code Beautifier](/tools/code-beautifier) snippet runner — but most users find that previewing matches is enough to predict how a replace will behave.
A positive lookbehind `(?<=foo)bar` matches "bar" only when preceded by "foo". They have been part of standard JavaScript since 2018 and work in every modern browser. Some older PCRE implementations and older regex engines do not support them — verify before deploying to non-JS environments.
The browser engine will run your pattern as-is. A pathological pattern like `(a+)+$` against a long input can hang the page tab; if that happens, refresh and rewrite the pattern with a possessive or atomic group. The tester does not pre-emptively warn about ReDoS, so test on representative inputs before shipping.
No. Both stay in the browser tab. Nothing is sent to a server, nothing is cached, and nothing is logged. Closing the tab discards them.