Développement

Testeur d’expressions régulières

Testez des motifs, groupes et remplacements.

Testeur d’expressions régulières

Propulsé par UtilBrix

JavaScript regular expressions. Processing runs in a worker and stops after 3 seconds. Quick reference: \d digit, \w word, \s whitespace, + one or more, * zero or more, ^ start, $ end.

Vos données restent dans votre navigateur. Aucun compte requis.

Les méthodes détaillées et les exemples sont disponibles en anglais.

Step-by-step instructions (English)

  1. Enter a JavaScript regular-expression pattern and the desired flags.
  2. Paste representative test text, including examples that should not match.
  3. Optionally enter a replacement string, then inspect matches, groups, indexes, and replacement output.

Formule et méthode

The browser executes JavaScript RegExp semantics in a dedicated worker. Match details include text, zero-based UTF-16 indexes, captured groups, and named groups. The replacement string follows JavaScript replacement conventions, including $1 and named references.

Exemple pratique

The pattern \d+ with flag g finds 12 and 34 in order 12, item 34. A worker timeout stops patterns that take too long.

When this tool is useful

Develop a pattern for text extraction or cleanup before adding it to an application. Testing both matching and nonmatching examples helps catch a pattern that works on one sample but accepts too much.

Common mistakes and limitations

  • Regular-expression syntax and flags differ between languages; this tool uses JavaScript semantics.
  • A pattern can be expensive on long input. The worker time limit protects the page, but a timeout means the pattern needs review.

Practical questions about this tool (English)

Why am I seeing only one match?

Check the global g flag if you intend to find repeated matches. Other flags such as i and m affect case sensitivity and line boundaries rather than enabling all matches.

What do match indexes count?

Indexes are zero-based UTF-16 positions, matching JavaScript string indexing. Some visible symbols occupy multiple code units, so the index can differ from a visual character count.

Autres outils utiles

Installer UtilBrix

Accédez à vos outils depuis l’écran d’accueil.

  1. Ouvrez le menu du navigateur (⋮).
  2. Choisissez «Installer l’application» ou «Ajouter à l’écran d’accueil».
  3. Confirmez l’ajout de UtilBrix à l’écran d’accueil.

Si cette option manque, ouvrez la page dans Chrome sur Android.

Rechercher un outil

↑ ↓ Navigate · Enter Open · Esc Close