Regex Tester

Enter a Pattern, optional Flags such as gi, and the Text to search. Matches update live via RegExp and String.match, then print as indented JSON so you can copy the array of hits.

Updated 2026-08-03 · developer

[ "hello", "HELLO" ]

About this tool

The tester builds new RegExp(pattern, flags) on every change. Successful runs show JSON.stringify of the match array (or []). Invalid patterns or flags surface the error message instead of silent failure.

How to use

  1. Enter the pattern: Type the expression body without surrounding slashes (sample default is hello).
  2. Set flags: Add flags such as gi in the Flags field, or leave blank for none.
  3. Provide sample text: Paste the string to test in the Text area.
  4. Read the matches: Review the JSON array of matches, or the error string if the pattern is invalid.

Common use cases

Tips

FAQ

Which regex engine is used?

The browser’s JavaScript RegExp implementation via new RegExp and String.match.

What does empty matches look like?

An empty JSON array [] when nothing matches a valid pattern.

Why do I see an error string?

The pattern or flags threw when constructing RegExp; fix syntax and try again.

Is my text uploaded?

Matching runs in your browser as you edit; no signup is required.

Related keywords

Related tools