All demos
Regex lab
Write a pattern, watch every match and capture group light up as you type.
Flags
g is always on here: the point is to see every match.
3 matches
Highlighted matches
- user
- ops
- host
- example.com
- user
- hello
- host
- example.com
- user
- matvejs
- host
- academy.lv
How it works
The pattern is recompiled on every keystroke with the flags you pick, then matched against the sample with `matchAll`, so every occurrence is found and listed with its capture groups and offset. The demo caps how many matches it draws, and warns about quantifiers nested inside quantified groups — JavaScript regular expressions cannot be interrupted mid-match, so a warning is the honest thing to offer.
Built withJavaScript · TypeScript