Regex Tester & Debugger
Try JavaScript regular expressions against sample text. Matching runs only when you press Run, in a disposable worker with a time limit.
Ready. Nothing runs until you select Run pattern.
Matches & highlighted text
Run a pattern to see results.
Full matches and captures
Replacement preview
Uses JavaScript String.replace replacement tokens, including $&, $1 and $<name>. Output is rendered as text.
Pattern explanation
Enter a pattern to get a concise syntax walkthrough. Explanations are heuristic and may omit context.
Supported syntax
This tester uses the JavaScript RegExp engine and supports g i m s u y. The global (g) and sticky (y) modes cannot be used together here; selecting either turns the other off. Lookbehind and other features depend on the browser's JavaScript engine.
Safety and limits
Regex complexity warnings are heuristic only. They are not a proof that a pattern is safe; there is no guarantee against catastrophic backtracking. Each run is isolated in a Web Worker that is terminated after 750 ms, and the tester limits patterns and replacement strings to 2,000 characters, test text to 50,000 characters, reported matches to 500, and displayed replacement output to 200,000 characters. Workers keep a slow pattern from freezing the page, but limits can truncate results or time out valid complex expressions. Use a smaller input or a simpler pattern when this happens.
Common mistakes
- Use
\\.for a literal dot;.matches most characters. ^and$match input boundaries (or line boundaries withm).\\dis an ASCII digit; use an explicit Unicode-aware expression if you need other numeral systems.- Use
(?:…)for grouping without a capture, and\\bonly for regex word boundaries, not all language-specific word edges.
All matching and replacement happen locally in your browser. Patterns and test text are not uploaded or saved.