Regex Tester

Write a pattern, set flags, and run it against sample text. Matches update instantly with indexes and optional capture groups.

Regular expression

Matches3
  • #1 index 0: hello
  • #2 index 6: world
  • #3 index 12: 123

How to use this tool

Enter a regular expression in the Pattern field using JavaScript syntax. Add flags in the adjacent Flags input — common choices include g for all matches, i for case insensitivity, and m for multiline anchors. Paste or type the sample text you want to search below.

Results appear as a list of matches with their start index and matched substring. When you use capturing parentheses, each group is listed so you can verify extraction logic before dropping the pattern into application code. The match counter helps confirm whether global scanning behaves as expected.

Use this page to debug validators, log parsers, and rewrite rules without bouncing between docs and a REPL. Because evaluation happens locally, you can test realistic production strings safely. Combine it with the diff checker to compare outputs before and after a regex replacement.

Frequently asked questions

Which flags are supported?
Any valid JavaScript RegExp flags such as g, i, m, s, u, and y. Enter them together in the Flags field, for example gi for global and case-insensitive matching.
How are capture groups shown?
Each match lists its index and full match text. When your pattern includes parentheses, numbered groups appear beneath the match for quick inspection.
Why does my pattern show an error?
Invalid syntax or unsupported constructs for JavaScript regular expressions trigger a parser error with a short message. Adjust the pattern and the tester updates live.

More developer tools