Validate regex patterns, inspect capture groups, and confirm match scope with highlighted preview.
Ready
Highlighted preview
Matches
0
Capture groups
0
Flags
g
Use regex testing when validating extraction patterns, migration scripts, or text normalization rules.
Capture groups and index data help verify precise matching behavior before code changes.
Yes. You can toggle common flags such as global, case-insensitive, multiline, dotAll, unicode, and sticky.
Yes. Each match result includes the match index and any capture group values.
Yes. The preview panel highlights matched segments so you can verify pattern scope quickly.
Use this regex tester online to try a JavaScript pattern, see each capture group, and confirm where each match starts and ends before you put it in code.
Matches are highlighted in your text and listed in a plain report, which helps when you debug log parsing, extraction scripts, or form validation rules.
Input
Pattern: (\d{4})-(\d{2})
Flags: g
Text: Paid 2025-11, due 2026-03.Output
Pattern: /(\d{4})-(\d{2})/g
match 1:
index: 5
value: 2025-11
group 1: 2025
group 2: 11
match 2:
index: 18
value: 2026-03
group 1: 2026
group 2: 03Index counts from 0 in UTF-16 units, so "2025-11" starts at position 5. The Groups counter shows 4, because it adds up the groups of every match instead of counting those in the pattern.