Regex Inspector

Build a JavaScript RegExp, test it against sample text, and inspect each match and capture group

Pattern
JavaScript regex syntax (same as in code)

Without g, all matches are still listed (the tool adds g only for scanning). Your flags affect capturing and other behavior.

Test string
Text to run the pattern against
Result
3 matches
Effective pattern for display:/\w+/g
Match 1 · index 0

hello

Match 2 · index 6

regex

Match 3 · index 12

world