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.
[
"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
- Enter the pattern: Type the expression body without surrounding slashes (sample default is hello).
- Set flags: Add flags such as gi in the Flags field, or leave blank for none.
- Provide sample text: Paste the string to test in the Text area.
- Read the matches: Review the JSON array of matches, or the error string if the pattern is invalid.
Common use cases
- Prototype a capture pattern before dropping it into app code.
- Check whether global and case-insensitive flags behave as you expect.
- Debug a failing validation regex against real sample strings.
Tips
- Flags must be valid JavaScript RegExp flags (for example g, i, m)—bad flags throw.
- Without g, match may return only the first hit plus group details; with g you get all matches.
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.