Developer Tools

Regex Cheat Sheet 2026 - Complete Regular Expression Reference

The ultimate regex cheat sheet with examples. Learn regular expression syntax for JavaScript, Python, Go, and more.

August 5, 20265 min read

Regex Basics

PatternMeaningExample
.Any character (except newline)a.c matches "abc", "adc"
\dAny digit (0-9)\d{3} matches "123"
\wWord character (a-z, A-Z, 0-9, _)\w+ matches "hello_world"
\sWhitespace\s+ matches spaces/tabs
^Start of string^Hello matches "Hello world"
$End of stringworld$ matches "Hello world"

Quantifiers

PatternMeaning
*0 or more
+1 or more
?0 or 1
{n}Exactly n times
{n,m}Between n and m times

Common Patterns

  • Email: ^[\w.-]+@[\w.-]+\.\w{2,}$
  • URL: https?://[\w.-]+(?:/[\w.-]*)*
  • Phone: \+?\d{1,3}[-.\s]?\d{3,4}[-.\s]?\d{4}

Test Your Regex

Use our Regex Tester to test patterns with live match highlighting and capture group display.