Regex Tester & Debugger Online
Test, validate, and debug JavaScript Regular Expressions in real-time. Features live syntax highlighting, capturing groups extraction, and powerful find & replace tools.
📖 Regex Rules Cheat Sheet & Guide
Comprehensive cheat sheet explaining character classes, quantifiers, anchors, and lookarounds to help you build regex patterns with confidence.
1. Character Classes
.Matches any single character except newline\dMatches any digit (0-9)\DMatches any non-digit character\wMatches any word character (alphanumeric & underscore)\WMatches any non-word character\sMatches any whitespace character (spaces, tabs, line breaks)\SMatches any non-whitespace character[abc]Character set: Matches 'a', 'b', or 'c'[^abc]Negated set: Matches any character EXCEPT 'a', 'b', or 'c'2. Quantifiers
*Matches 0 or more occurrences+Matches 1 or more occurrences?Matches 0 or 1 occurrence (Optional){n}Matches exactly n times{n,}Matches n or more times{n,m}Matches between n and m times3. Anchors & Boundaries
^Matches start of string (or start of line with m flag)$Matches end of string (or end of line with m flag)\bWord boundary - matches position between word and non-word4. Groups & Logic
(abc)Capturing group - Stores match in $1, $2(?:abc)Non-capturing group - Groups without storing $ referencea|bOR logic - Matches a or b💡 Visual Pattern Breakdown Examples
Email Pattern Breakdown: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$- •^ : Start of string.
- •[a-zA-Z0-9._%+-]+ : Username containing letters, numbers, or allowed special characters.
- •@ : Required @ symbol.
- •[a-zA-Z0-9.-]+ : Domain name string.
- •\. : Escaped dot separating domain and TLD.
- •[a-zA-Z]{2,} : Top-Level Domain (TLD) with 2 or more letters.
- •$ : End of string.
Online Regex Tester - Free Regular Expression Debugger
Learn how to use our online Regex Tester to test patterns, extract capturing groups, and execute string replacements safely inside your browser.
1. Instant Real-time Evaluation
Evaluates and highlights matches instantly as you type your pattern or test string without requiring page reloads.
2. Capturing Group Inspection
Breaks down captured groups ($1, $2, $3...) with index positioning and match length breakdown.
3. Built-in Regex Library
Includes instant presets for validating emails, phone numbers, URLs, IPv4 addresses, dates, and hex colors.
Frequently Asked Questions (FAQ)
Q: Is my input text processed securely?
Yes, 100%! All regular expression evaluations run strictly client-side within your web browser using local JavaScript engines.
Q: What do regex flags (g, i, m, s, u, y) stand for?
g = Global match; i = Case insensitive; m = Multiline mode; s = Dot matches all (dotAll); u = Unicode support; y = Sticky search.
Q: How do replacement references ($1, $2) work?
Use $1 for the first captured group in parentheses, $2 for the second group, and so on. For example, replacing pattern `(\w+)\s(\w+)` with `$2, $1` flips word order.