Regex Debugger
What the Regex Debugger does, who it's for, and how it tests patterns live — your starting point for the manual, examples, and tips.
Regular expressions without the guesswork
Regular expressions are powerful but unforgiving: one misplaced character and your pattern matches nothing — or suddenly far too much. The Regex Debugger takes the guesswork out of it. You type your regex pattern into one field and your test text into the other, and the tool shows you instantly what matches: every hit highlighted in color inside the text, plus a list with position and all capture groups.
There's no "Run" button to wait for — evaluation happens in real time as you type. Edit the pattern and the matches follow along. That immediate feedback is what makes the difference: while you build, you see whether \d{3} actually fires, whether your capture group grabs the right thing, and exactly where your pattern gets too greedy.
The tool is built for everyone who works with patterns: developers building and testing an expression for validation, search, or replacement; admins and DevOps picking apart log lines or config values; and anyone learning regex who needs something visible to react against instead of simulating it in their head. Everything runs in the browser — no account, no installation.
What the tool does — at a glance
The interface is two columns: pattern, test text, and matches on the left, a built-in cheat sheet on the right. In detail:
- Pattern — the editor for your regex pattern. That's the bare expression, without the surrounding slashes; you pick the flags separately.
- Flags — six toggles for
g,i,m,s,u, andy.g(global, all matches) is on by default. - Test String — the input for the text your pattern runs against. Multi-line, with line numbers.
- Matches — the results list: a counter ("N matches"), and for each hit the matched text, its position in the string, and all numbered and named capture groups.
- Highlighting — every match is also marked in color directly in the test text (four rotating colors so consecutive hits stay distinguishable).
- Copy pattern — copies your pattern with flags in literal format
/pattern/flagsto the clipboard. - Clear all — empties both editors and resets the flags to the default (
g). - Error display — if your expression is syntactically invalid, the engine's original error message appears instead of a match list.
- Cheat Sheet — a collapsible reference (Characters, Quantifiers, Groups, Anchors, Lookaround, Character Classes, Flags) right next to the editor.
Which engine: native JavaScript
Important for working accurately: the debugger uses your browser's native JavaScript RegExp API — not PCRE, not the Python or .NET variant. Your pattern is evaluated internally as new RegExp(pattern, flags). That has two consequences:
- You test the exact engine that will later run in your JavaScript, Node.js, or TypeScript code. What matches here matches there.
- You need to know the JavaScript limits: the six flags
g/i/m/s/u/y, named groups ((?<name>…)), and lookahead and lookbehind are available. PCRE specialties such as atomic groups, possessive quantifiers, recursion, or POSIX classes ([[:alpha:]]) are not. More on this in the manual and the tips.
Try it now
→ Open the Regex Debugger — type a pattern, paste test text, read the matches live. No account, free, right in the browser. The tool starts with a ready-made example ((?<word>\w+) on a short sentence) so you can see immediately how matches, position, and a named group are displayed.
Related JPKCom tools
Regex is rarely an end in itself — it usually sits inside a larger text or code workflow:
- Coder — encodes and decodes HTML entities, URLs, Base64, JWT, and data URIs; handy before or after you slice strings with regex.
- Source Viewer — displays and highlights source code in over 100 languages; great for finding the spot your pattern should target.
- JSON Editor — formats and validates JSON; often the cleaner choice than a regex when you need to take structured data apart.
- Beautify — formats JavaScript, CSS, and HTML; helps make a long string readable before you point a pattern at it.
There's more on the subpages: the manual with every feature and the engine limits in detail, examples with runnable walkthroughs, and a collection of tips & tricks.