1001Ferramentas
📑 Dev

Regex Cheatsheet

Quick reference of the main regular expressions — quantifiers, classes, anchors, groups, lookarounds, flags. With clickable examples and explanations. Everything in your browser.

A quick regular-expression reference

Regular expressions do a lot, but the syntax slips out of memory between one use and the next. This cheat sheet gathers the most important regex elements in one place, so you can refresh the syntax without digging through the documentation.

Quantifiers, character classes, anchors, groups, lookarounds and flags are all covered, each with an example and an explanation of what it does. The search box at the top filters the whole list by symbol or by description, so two letters are usually enough to land on what you want. It's good both for someone learning and for someone who just wants a quick reminder.

It all stays available in the browser, with no install. It's the right reference to keep at hand next time you go to write a regex.

Frequently asked questions

Does the filter box take a regular expression?
No, it runs a literal search. Whatever you type is looked for as a plain substring of each row's symbol and description, case-insensitively and without interpreting metacharacters, so typing a dot does not bring back everything, it brings back the rows with a dot written in them. Searching for lazy surfaces the two lazy quantifiers, and any section left with no matching row disappears instead of showing up empty.
Can I test my pattern against some text here?
No, this page is reference only. It holds 42 rows across seven blocks, running from anchors, character classes and quantifiers to groups, lookaround, flags and ready-made recipes, each with the symbol and a one-line explanation. There is no test field and no copy button, so you select the symbol with the mouse. To actually try a pattern out, the site has a Regex Tester that runs it against your text and shows the captured groups.
Does the syntax listed here work in Python, PHP or grep?
Most of it does, but the sheet follows the JavaScript dialect and a few rows do not travel. The sticky y flag and the lastIndex behaviour belong to JavaScript alone. Python has no global flag, since the function you call decides between one match and all of them. Basic grep, without the -E option, treats plus, question mark and braces as literal characters rather than quantifiers. Lookbehind is standard, yet it only reached Safari in version 16.4, back in 2023.

Related Tools