NewKit / Reference / Regex Cheatsheet

Regex Cheatsheet

Quick guide to regex symbols and patterns. · Processed in your browser.

PatternMeaning
.cualquier carácter (menos salto de línea)
\d / \Ddígito / no dígito
\w / \Wpalabra [A-Za-z0-9_] / no palabra
\s / \Sespacio en blanco / no espacio
^ / $inicio / fin de línea
\b / \Blímite / no límite de palabra
a* / a+ / a?0 o más / 1 o más / opcional
a{2,4}entre 2 y 4 repeticiones
[abc] / [^abc]uno de / ninguno de
(a|b)a o b
(?:…)grupo sin captura
(?=…) / (?!…)lookahead positivo / negativo
(?<=…) / (?lookbehind positivo / negativo
\1referencia al grupo 1
Flags: g i m s uglobal · ignorecase · multiline · dotall · unicode

What is Regex Cheatsheet?

Regular expressions are powerful but hard to memorize. This cheat sheet gathers the most used metacharacters, quantifiers and constructs —character classes, anchors, groups, lookaheads and flags— with a brief explanation of each.

Keep it handy while writing a regex to quickly recall how to express "one or more", "optional", a word boundary or a non-capturing group. It's a compact reference so you don't have to look up the syntax every time.

Frequently asked questions

What does \d mean in a regular expression?

It matches any digit (0–9). \D is the opposite: any non-digit character.

How do I make a part optional?

With the ? quantifier after the element: colou?r matches both "color" and "colour".

What is a non-capturing group?

(?:…) groups without saving the result, handy to apply quantifiers without creating a capture reference.

Is it free?

Yes, all NewKit tools are completely free.

Is my data sent to a server?

No. Processing happens 100% in your browser, so it is safe even for sensitive data.