Home/Regex Tester & Cheat Sheet

Regex Tester & Cheat Sheet – Test Regular Expressions Online

4.1 Rating from 132 people who voted
Share this page
Regex Tester Test regular expressions in real-time
Highlighted Output

Character Classes

.Any char except newline
\wWord char [a-zA-Z0-9_]
\WNon-word char
\dDigit [0-9]
\DNon-digit
\sWhitespace
\SNon-whitespace
[abc]Any of a, b, c
[^abc]Not a, b, c
[a-z]Range a to z

Anchors & Boundaries

^Start of string/line
$End of string/line
\bWord boundary
\BNon-word boundary
\AStart of string
\ZEnd of string

Quantifiers

*0 or more
+1 or more
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m
*?Lazy match

Groups & Lookarounds

(...)Capturing group
(?:...)Non-capturing group
(?=...)Positive lookahead
(?!...)Negative lookahead
(?<=...)Positive lookbehind
(?Negative lookbehind
x|yMatch x or y
\1Backreference

Common Patterns

[\w.-]+@[\w.-]+\.\w+Email
https?:\/\/[^\s]+URL
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\bIP Address
\d{4}-\d{2}-\d{2}Date (YYYY-MM-DD)
#([0-9a-fA-F]{3}){1,2}\bHex Color
<([a-z]+)([^<]+)*(?:>.*<\/\1>|\s+\/>)HTML Tag

Flags (Modifiers)

gGlobal match
iCase-insensitive
mMultiline
sDot matches newline
uUnicode support
ySticky match

About the Regex Tester & Cheat Sheet

The Regex Tester highlights matches in your test string in real time as you type your pattern, with a full breakdown of each match’s index and captured groups. Alongside the tester, a searchable library of 250+ ready-made patterns and a full syntax cheat sheet covering character classes, anchors, quantifiers, and lookarounds are just a tab away.

It’s built for developers validating input formats, debugging tricky patterns, or learning regex syntax without leaving the browser. Once you’ve confirmed a pattern works, the Email Extractor puts email-matching regex to practical use pulling addresses from bulk text, and the UUID Generator pairs well if you’re validating UUID formats with the pattern library’s built-in UUID regex.

BigToolSite Team tested this tool against multi-group captures, Unicode flag behavior, and zero-width matches to confirm the highlighting and match list stay accurate across common and edge-case patterns.

How to Use the Regex Tester & Cheat Sheet

  • Type or paste your pattern into the Regular Expression field.
  • Toggle flags like g, i, or m to change matching behavior.
  • Paste your Test String to see matches highlighted instantly, along with a full match list.
  • Browse the Pattern Library tab to search and load ready-made patterns by category.
  • Switch to the Syntax Cheat Sheet tab and click any symbol to load it directly into the tester.

Example Usage

Input Pattern: \b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b

Test String: Contact us at [email protected] or [email protected]

Output: Two matches highlighted: [email protected] and [email protected], each listed with its index position in the match list below.

This same pattern is available directly in the Pattern Library under the Validation category, so you can load it with a single click instead of typing it out. Once you’ve confirmed the pattern works, the JSON Formatter is useful for validating any structured data your regex extracts from a larger file.

Frequently Asked Questions

It uses JavaScript’s native regular expression engine, so syntax and behavior match what you’d get in a browser console or Node.js, which covers most common patterns used across other languages as well.

Clicking any symbol or pattern in the cheat sheet or pattern library loads it directly into the tester’s pattern field, so you can immediately test it against your own text.

Yes, you can filter by category using the dropdown, or search by name, pattern, or description using the search box, and both can be combined for more precise results.

If a group in your pattern is optional and doesn’t match anything in the current test string, it’s still listed but shown as an empty string rather than being omitted.

Yes, it’s completely free to use.