Regex Tester
Developer utilities · Done in 3 steps
- 1Type a pattern
- 2
- 3
About
Test JavaScript regular expressions with live match highlighting, a groups table, replace preview, cheat sheet and ready-made patterns.
How to use it
- 1Type a pattern and toggle flags (g, i, m, s, u, y).
- 2Paste a test string — matches highlight as you type.
- 3Open Match details for indexes and capture groups, or Replace to preview substitutions.
- 4Pick a common pattern (email, URL, date…) to start from.
- You give
- A JavaScript regex pattern, flags and test text
- You get
- Highlighted matches, capture groups, replacement output
- Good to know
- JavaScript (ECMAScript) syntax only — PCRE features like possessive quantifiers, recursion or inline (?i) flags aren't supported. Matching stops after 1.5 s and shows at most 5,000 matches.
- Privacy
- Processed on your device. Nothing is uploaded, stored or logged.
- Last tested
- 2026-10-28
FAQ
Can a bad pattern freeze the page?
No. Matching runs in a Web Worker that is terminated after 1.5 seconds, so catastrophic backtracking just shows an error.
How do I reference groups in the replacement?
Use $1, $2… for numbered groups, $<name> for named groups, $& for the whole match and $$ for a literal dollar sign.
Will my regex work in Python or PHP?
Most simple patterns are portable, but lookbehind, named group syntax and Unicode classes differ between engines. Test in the target language before shipping.
Go further with AI
Code review checklist
A severity-ranked review checklist for humans and AI reviewers covering correctness, security, data, performance, tests and maintainability.
Claude Code · Cursor · Claude
Bug reproduction template
Turn a vague bug report into minimal reproduction steps, ranked hypotheses and a failing test you can hand to a developer or coding agent.
Claude Code · Cursor · Claude
UI implementation brief
Write a precise brief for building a UI component with a coding agent: states, behaviour, accessibility, responsive rules and acceptance criteria.
Claude Code · Cursor · Claude
Accessibility review workflow
Review a component or page against WCAG 2.2 AA with automated checks, an AI code review and a short manual keyboard and screen-reader pass.
Claude Code · Cursor · Claude