How to test a regular expression

Regex is easiest to get right with instant feedback. Here's how to test a pattern against sample text.

Open Regex Tester

Steps

  • Open the regex tester and enter your pattern.
  • Paste sample text to match against.
  • Matches highlight live; capture groups are listed.
  • Toggle flags (g, i, m, s, u) to refine the behavior.

Which flavor

The tester uses JavaScript's RegExp engine — the same one that runs in browsers and Node — so what you see here is exactly how your pattern behaves in JS code.

Tools used in this guide

Related guides

How to test a regular expression — FAQ

Enter the pattern and sample text in the tester — matches highlight live and capture groups are shown.