reference

Regex Cheat Sheet

A practical JavaScript regex cheat sheet for anchors, character classes, groups, quantifiers, and flags.

Last reviewed:

Use this regex cheat sheet as a compact reference, then test every expression in the Regex workspace with realistic input.

Anchors and character classes

Groups and repetition

JavaScript flags

Use g for all matches, i for case-insensitive matching, m for line anchors, s for dot-all, and u for Unicode-aware patterns. Regex uses JavaScript syntax, so check your destination environment before copying a pattern.