Regex Cheatsheet
How to use this regex cheatsheet
- Browse by category, or search for a keyword.
- Each pattern shows a short description of what it matches.
- Click any pattern to copy it to your clipboard.
Where can I test these patterns?
Use OmniDeck's Regex Tester tool to try any of these patterns against real text and see live matches highlighted.
Do these patterns work the same in every programming language?
Mostly yes for basic syntax, but there are differences between regex "flavors" (JavaScript, PCRE, Python's re module, etc.) for advanced features like lookbehind or named groups — always test in your actual environment.
Why does my pattern match more or less than expected?
Regex is greedy by default (it matches as much as possible) — for shorter, more precise matches, use a non-greedy quantifier like *? or +?, and double check your character classes and anchors.