Regex Tester & Cheat Sheet
Test regular expressions dynamically in your browser. Enter your regex pattern and flags, input sample text, and review captured patterns instantly.
Matched Outputs Summary
Matches Found:
0
Matches highlighted in yellow...
| Match | Index | Full Match & Groups Details |
|---|---|---|
| No capture group results compiled. | ||
Regular Expressions Syntax Cheat Sheet
| Character | Name | Matches Description |
|---|---|---|
. |
Any Character | Matches any single character except newline. |
\d, \D |
Digit, Non-Digit | \d matches [0-9]. \D matches any character other than digits. |
\w, \W |
Alphanumeric, Non-Word | \w matches basic word characters [a-zA-Z0-9_]. \W matches symbols/spaces. |
*, +, ? |
Quantifiers | * (0 or more times), + (1 or more times), ? (0 or 1 time). |
{n}, {n,m} |
Range Quantifiers | Matches exactly n times, or between n and m times. |
[a-z], [^a-z] |
Character Set / Negation | Matches any character inside the brackets. ^ negates the set. |
^, $ |
Anchors | ^ asserts position at the start of string. $ asserts position at the end. |
(...) |
Capture Group | Groups multiple tokens together and saves matched strings for reference. |
✔ Done — what’s next?
You may also need
- Base64 Encoder / Decoder — Encode or decode Base64 text, and turn images into Base64 data URIs.
- UUID v4 Generator — Generate random UUIDs/GUIDs in bulk with formatting options.
- SHA Hash Generator — Compute SHA-256, SHA-384, SHA-512 and SHA-1 hashes as you type.
- Cron Expression Builder — Build cron schedules visually with plain-English descriptions and next run times.
- CSS Grid & Flexbox Generator — Design CSS Grid and Flexbox layouts visually and copy the code.
- CSV to JSON / Excel Table Converter — Paste or upload CSV and get JSON plus a spreadsheet-style table preview.
Popular next tools
ADVERTISEMENT
Google AdSense - Responsive Content Banner (600 x 100)
How to use the Regex Tester & Cheat Sheet
- Type a pattern and flags.
- Paste test text.
- See matches highlighted live.
What are Regular Expressions and How are they Used?
A Regular Expression (Regex) is a sequence of characters defining a search pattern. They are widely used in search engines, validation scripts, database query modules, and text editors for pattern-matching operations.
Writing regular expressions can be error-prone. This interactive tester parses JavaScript regex rules and formats matches dynamically as you type. By running locally in your browser, it provides a safe sandbox to test patterns against sensitive inputs without data leaks.
Frequently Asked Questions (FAQ)
Q: Why am I getting a regex syntax error?
A: Ensure that parentheses
(), square brackets [], and curly braces {} are properly closed. Escape special syntax characters like /, ., or ? with a backslash \ if you want to match them literally.Q: What is the difference between global (g) and multiline (m) flags?
A: The
g flag queries all match occurrences in the string instead of stopping after the first match. The m flag changes anchors ^ and $ to match the start/end of each individual line instead of the entire string.Q: Are backreferences and advanced groups supported?
A: This tool runs on standard browser JavaScript RegExp engines, supporting capture groups, lookaheads, lookbehinds, and basic backreferences.