DevToolbox

โ†‘ โ†“ to select ยท Enter to open ยท Esc to close

Regex Tester

Test a JavaScript regular expression against text and inspect matches and capture groups.

No matches

How to use the Regex Tester

Test a JavaScript regular expression against text and inspect matches and capture groups.

Steps

  1. Enter a pattern without slash delimiters.
  2. Set JavaScript regular-expression flags; the default is g for global matching.
  3. Paste a test string and review each match and its index.

Example: Find the whole word โ€œcatโ€

Pattern: \bcat\b
Flags: gi
Text: A cat sat beside a catalogue.

Limitations

Patterns use the browserโ€™s JavaScript RegExp engine, not every languageโ€™s regex dialect. Avoid untrusted or very complex patterns; matching time depends on the expression and input.