- 1042index 6
- 2026index 22
- 10index 27
- 08index 30
- 3index 36
Regex Tester for JavaScript Patterns
Test a JavaScript regular expression against sample text and see every match and its position, live in your browser.
What it does
Regex Tester runs a JavaScript regular expression against text you paste in and lists every match with its position as you type. Flags like case-insensitivity or multiline are typed directly, and matching always covers the whole text, not just the first hit. It suits developers validating a pattern before dropping it into code, without leaving the browser.
How to use it
- Type your pattern into the Pattern field and adjust the Flags field.
- Paste or edit the text in the Test text box.
- Review the match count and the list of matches with their index.
Example
- Input
- Pattern \btool\w* with flags gi over "Fast tools make repeated tool work easier."
- Output
- 2 matches: "tools" at index 5, "tool" at index 25
What happens to your file
- Your file or text is processed by code running in this browser tab. It is not uploaded to any server.
- The processing code is downloaded from this site with the page; nothing about your input is sent back.
- The result is created on your device and saved only when you choose to download it.
Limits
- Only the JavaScript regular expression engine is supported, not PCRE, Python or other regex flavors.
- The visible results list shows at most the first 50 matches, though the match count covers the whole text.
- Matching is applied to the whole input as plain text; there is no per-line or multi-file mode.
Questions
Which regex flavor does this use?
It uses the JavaScript RegExp engine built into your browser, so any pattern and flag combination valid in JavaScript works here.
What happens if my pattern is invalid?
The tool shows the JavaScript engine's own error message for the invalid pattern instead of a match list.
Does it only find the first match?
No. The global flag is applied internally even if you do not type it, so all matches in the text are listed, not just the first one.
Is there a limit on how many matches are shown?
The match list displays up to the first 50 matches; the match count above it still reflects the true total.
Are capture groups shown?
Each match's captured groups are collected internally, but the visible list currently shows the full matched text and its index rather than each group value.