Development
Regex Cheatsheet
Find JavaScript character classes, quantifiers, anchors, groups, and flags, then verify their behavior with a concrete test string.
About this tool
When to use it
Find JavaScript character classes, quantifiers, anchors, groups, and flags, then verify their behavior with a concrete test string.
How to use it
Search by the feature you need, read its explanation, and copy the relevant syntax. Some entries show alternatives separated by spaces; select the particular expression you need before using it in a pattern.
Guide updated . Examples checked against this implementation.
Worked examples
Group without adding a capture
Input
Search: Non-capturingExpected output
(?:abc)The group matches abc without adding a numbered capture. Add repetition outside the closing parenthesis only when repeating the entire group is intended.
Errors and unsupported input
Copying g i m s u y into the pattern fieldThese are alternative flags, not a pattern. Enter the required flag letters in the tester's Flags field and the pattern separately.
Continue this workflow
- Regex Tester: Verify copied syntax against matching and nonmatching fixtures.
Questions
Frequently asked questions
Does a cheatsheet example validate my input format?
No. It explains a building block. Compose and test the complete pattern against your own format and edge cases.