Regex Tester Online
Test and replace JavaScript regular expressions online in real time with flags, named groups, a matches table and a cheatsheet, right in your browser.
Quick reference
Character classes
- .
- Any character
- \d
- Digit [0-9]
- \w
- Word character [a-zA-Z0-9_]
- \s
- Whitespace
Quantifiers
- *
- Zero or more
- +
- One or more
- ?
- Zero or one
- {n,m}
- Between n and m
Anchors
- ^
- Start of string
- $
- End of string
- \b
- Word boundary
Groups
- (...)
- Capture group
- [...]
- Character class
- |
- Alternation (or)
- (?:...)
- Non-capturing group
Escapes
- \.
- Literal dot
- \\
- Literal backslash
Flags
- g
- Global — all matches
- i
- Ignore case
- m
- Multiline — ^ and $ per line