GUIDE

Regex cheat sheet

Start with a small JavaScript pattern and test realistic text.

On this page

Choose characters

A bracket group chooses characters. A plus repeats the preceding item one or more times. Backslash-d matches an ASCII digit. Enter the pattern directly, without surrounding slash delimiters.

[A-Za-z]+ matches words; \d+ matches digits

Choose flags

g finds successive matches; i ignores case; m changes line anchors; s lets the dot match newlines; u enables Unicode-aware handling; y matches only at the current position. Quietkit supports these JavaScript flags once each. PCRE and Python syntax may differ.

Check groups and boundaries

Parentheses capture text. Named groups label captures. The results list matched text, captured groups and zero-based UTF-16 positions. Test empty matches and non-matching text too; a pattern that works on one example is not a complete validator.

(?<number>\d+) captures a number

Keep work bounded

Nested repetition can take excessive time. Quietkit stops a test after one second and limits displayed matches to 1,000. Simplify a slow pattern and test again. A truncated result is not a count of all possible matches.