Regex Tester
Test a regular expression against text in your browser and see every match, capture group, and position. Supports g, i, m, s, u flags. Nothing is uploaded.
The text and pattern are tested in your browser and never sent to a server. The tool uses the browser’s built-in JavaScript RegExp engine only; there is no eval, no arbitrary code execution, and no AI. It does not match PCRE, Python, or .NET regex on every feature, and it is not a replacement for a professional email or URL validator.
A free regex tester that runs a regular expression against your text in real time, right in your browser. Type a pattern, toggle the g, i, m, s, and u flags, and paste some text; the tool lists every match with its position, and shows numbered and named capture groups. It uses the browser’s built-in JavaScript RegExp engine only, with no eval and no server calls, and it caps very large inputs and match counts so a heavy pattern cannot freeze the page. It is a fast way to build and debug a pattern. Nothing you type is uploaded or stored.
How to use this tool
- 01Write a patternType your regular expression in the pattern box. An invalid pattern shows an inline error.
- 02Pick flagsToggle g (global), i (ignore case), m (multiline), s (dotAll), and u (unicode) as needed.
- 03Paste text and read matchesPaste text to test, and the tool lists every match, its position, and any capture groups.
When is this useful?
- Build a patternWrite and refine a regex against real sample text until it matches what you want.
- Debug a matchSee exactly what a pattern captures, including group values, to fix a bug.
- Learn regexTry the flags and quick examples to understand how each part behaves.
Examples
- DigitsThe pattern \d+ with the g flag finds every run of digits in the text.
- Words[A-Za-z]+ matches each word; the match list shows their positions.
- Capture groupsA pattern with parentheses shows each group value under the match, numbered from $1.
Formula or how the tool works
The tool compiles your pattern and flags into a JavaScript RegExp and runs it against the text with the engine’s matching. With the g flag it lists all matches; without it, it still lists matches for you but notes when g was applied internally. Capture groups come straight from the match result.
Inputs, outputs, and assumptions
You enter a pattern, choose flags, and paste text. The tool returns the match count, each match with its start and end position, and numbered and named groups. It assumes JavaScript regex syntax; other flavors differ.
Supported modes or scenarios
Use the g, i, m, s, and u flags in any combination. Load a quick example to start, then edit the pattern. It handles Unicode text, including non-Latin scripts, when the u flag is on.
Limitations and common mistakes
This uses the JavaScript RegExp engine, so it does not match every feature of PCRE, Python, or .NET regex, such as lookbehind support that varies by engine. Very long inputs and huge match counts are capped for safety, and the tool is not a substitute for a professional email or URL validator.
Privacy and local processing
The pattern and text are tested in your browser using the built-in RegExp engine. There is no eval, no arbitrary code execution, and no AI, and nothing you type is uploaded or stored.
Frequently asked questions
Which regex flavor is this?
JavaScript (ECMAScript) RegExp, as built into your browser. Patterns that rely on PCRE, Python, or .NET-only features may behave differently.
What do the flags do?
g finds all matches, i ignores case, m makes ^ and $ match line boundaries, s lets . match newlines, and u enables full Unicode handling.
Can a bad pattern freeze my browser?
The tool caps very large inputs and match counts to reduce that risk, but extremely pathological patterns can still be slow. It only ever uses the safe RegExp engine, never eval.
Does it show capture groups?
Yes. Each match lists its numbered groups ($1, $2, ...) and any named groups.
Is my text uploaded?
No. Everything runs in your browser and nothing you type is sent to a server.
Related tools
- JSON FormatterFormat, minify, and validate JSON in your browser. Paste JSON to pretty-print or compact it, and see errors instantly.Open
- Text Diff CheckerCompare two texts line by line and see what was added, removed, or unchanged. Runs in your browser, nothing uploaded. Great for drafts, lists, messages, and code snippets.Open
- URL Encoder and DecoderPercent-encode text and query values for safe use in links, or decode percent-encoded URLs back to readable text. Runs in your browser, with full UTF-8 support.Open
- Hash Generator (SHA-256, SHA-1, SHA-512)Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes of text in your browser with Web Crypto. Nothing is uploaded.Open

