320 x 50 Mobile Ad
Cheat Sheets

Regex Cheat Sheet

Transform, format, and optimize your data instantly with this free client-side tool.

Character Classes

.

Any character except newline

\w

Word character (a-z, A-Z, 0-9, _)

\W

Non-word character

\d

Digit (0-9)

\D

Non-digit

\s

Whitespace (space, tab, newline, etc.)

\S

Non-whitespace

[abc]

Any character in the set (a, b, or c)

[^abc]

Any character NOT in the set

[a-z]

Any character in the range a to z

Anchors

^

Start of string (or line in multi-line mode)

$

End of string (or line in multi-line mode)

\b

Word boundary (between word and non-word characters)

\B

Non-word boundary

\A

Absolute start of string

\Z

Absolute end of string

Quantifiers

*

Zero or more occurrences

+

One or more occurrences

?

Zero or one occurrence (optional)

{n}

Exactly n occurrences

{n,}

n or more occurrences

{n,m}

Between n and m occurrences

*?

Zero or more, lazy (match as few as possible)

+?

One or more, lazy

Groups

(abc)

Capture group (matches 'abc' and remembers the match)

(?:abc)

Non-capturing group

(?<name>abc)

Named capture group

\1

Backreference to capture group 1

a|b

Alternation (a OR b)

Lookarounds

(?=abc)

Positive lookahead (matches if followed by 'abc')

(?!abc)

Negative lookahead (matches if NOT followed by 'abc')

(?<=abc)

Positive lookbehind (matches if preceded by 'abc')

(?<!abc)

Negative lookbehind (matches if NOT preceded by 'abc')

Modifiers

g

Global search (find all matches, not just the first)

i

Case-insensitive search

m

Multi-line search (^ and $ match start/end of lines)

s

Dotall mode (. matches newlines)

Advanced

Advanced Command Snippet

Explore advanced configurations for Regex

System Optimization

Performance tuning best practices for Regex

Security Audit

Run security checks and validation for Regex

320 x 50 Mobile Ad

Frequently Asked Questions

Got questions? We've got answers.

The Regex Cheatsheet is a quick-reference guide that provides developers with the most essential and frequently used Regex commands, syntax, and snippets in one centralized place.
This reference is built for both beginners who are just learning Regex and need a quick syntax lookup, as well as seasoned professionals who need to jog their memory on complex commands.
You can use the real-time search bar at the top of the cheatsheet. Simply type a keyword (like &#39;delete&#39; or &#39;file&#39;) and the list will instantly filter to show only matching Regex commands.
Yes! Every command block features a one-click copy button. Just hover over the command and click the copy icon to instantly send the snippet to your clipboard.
The cheatsheet is divided into logical categories such as Basics, Network, Operations, and specific Regex features. You can click on the category filters at the top to isolate specific groups of commands.
Absolutely. This Regex reference guide is 100% free, requiring no sign-ups or subscriptions, and is always available when you need it.
While these are standard Regex operations, you should always understand what a command does before running it, especially if it involves system operations or destructive actions.
Yes, we have recently expanded this cheatsheet to include advanced snippets, best practices, and edge-case syntax that go beyond basic introductory commands.
ADVERTISEMENT
Boost Your Business Online