Expression régulière

Match, capture, and replace text

Chargement de l’outil…

À propos de Expression régulière

Match, capture, and replace text

A pattern is easier to trust when its test set includes expected matches, near-misses, Unicode, line breaks, and empty input. The tester is most useful as a small reproducible case for a regex that will later live in application code.

Comment utiliser cet outil développeur

  1. Enter the expression, flags, and representative test text.
  2. Review full matches and capture groups, then add cases that should not match.
  3. Try the replacement operation only after the match boundaries are correct, and keep the test examples with the expression.

Confidentialité et traitement des données

Regular-expression matching runs in the browser. Avoid pasting personal records or log files containing secrets; use short representative samples instead.

Outils développeur associés

Questions fréquentes

Why does a flag change the result?

Flags can change case sensitivity, line boundaries, Unicode behavior, or whether matching continues after the first result. Test them deliberately.

Can a regex validate an entire document?

It can check a pattern, but a regex is not always the right parser for nested or structured formats such as JSON, XML, or programming languages.

What is a near-miss test?

It is an input that looks close to a valid match but should be rejected. Near-misses reveal missing boundaries and overly broad quantifiers.