Testeur Regex
Build, test and debug JavaScript regular expressions in real time. Live highlighting, capture groups, replace preview. Supports lookbehind, named groups and Unicode.
Test string
Highlighted
Replace result
A real-time regex playground in your browser
Build and debug regular expressions interactively. As you type the pattern, the test string is re-evaluated and matches are highlighted instantly. Capture groups (both numbered and named) show up in a side panel with their values for every match. No round-trip to a server, no signup, nothing tracked.
Syntaxe regex JavaScript native
We use the browser's own RegExp engine, which means the patterns you test here
will behave exactly the same in your JavaScript code. Modern features are all
supported: lookbehind (?<=...), named groups
(?<name>...), Unicode property escapes \p{...},
and the s (dotall) flag.
Mode remplacement
Toggle replace mode to preview a regex-based substitution. The replacement supports all the
standard $ tokens: $1, $2 for numbered groups,
$<name> for named groups, $& for the full match,
$` for text before the match, $' for text after, and
$$ for a literal dollar sign.
Protection ReDoS
Catastrophic backtracking — patterns like (a+)+$ on long input — can hang any
regex engine. We have two safety nets:
- Hard timeout: if matching takes longer than 2 seconds, we abort and tell you.
- Match cap: a maximum of 10,000 matches per evaluation. Beyond that we stop and mark "10000+" so the UI stays responsive.
Confidentialité
Your patterns and test text never leave the page. The engine is built into your browser. No external library is loaded, no analytics fires when you type, no requests go out.
Cas d'utilisation courants
- Validate email, URL, phone or postal-code patterns.
- Extract structured data from logs or scraped text.
- Build search-and-replace queries before running them in your editor.
- Debug a regex that "should work but doesn't" — the highlight makes the problem visible immediately.
- Learn regex by experimentation with the cheatsheet at the bottom.
Questions Fréquentes
- Comment tester une expression régulière en ligne ?
- Collez votre motif regex dans le champ de motif et votre chaîne de test dans la zone de texte. Les correspondances sont surlignées en temps réel au fur et à mesure que vous tapez, avec les groupes de capture affichés dans le panneau latéral.
- Ce testeur regex prend-il en charge tous les drapeaux JavaScript ?
- Oui, il prend en charge tous les drapeaux regex JavaScript : g (global), i (insensible à la casse), m (multiligne), s (dotall), u (unicode) et y (sticky).
- Mon regex ou mes données de test sont-ils stockés quelque part ?
- Non. Tout s'exécute localement dans votre navigateur. Vos motifs et votre texte de test ne sont jamais envoyés à un serveur ou stockés nulle part.
- Puis-je exporter mes correspondances regex ?
- Oui. Tous les groupes de correspondance et groupes de capture sont affichés dans le panneau de résultats, et vous pouvez utiliser le mode Remplacer pour prévisualiser les substitutions basées sur les regex.
- Ce testeur regex est-il gratuit ?
- Oui, entièrement gratuit sans limites d'utilisation, sans inscription requise et sans publicités interrompant votre travail.