iGuideSmart

Regex Tester & Debugger

Test regular expressions live with inline match highlighting, capture group inspection, flags (g, i, m, s, u), and a regex cheat sheet.

3 matches found
  • #1: "2026-11-18" @ index 15Groups: [2026, 11, 18]
  • #2: "2027-01-05" @ index 30Groups: [2027, 01, 05]
  • #3: "2026-12-31" @ index 48Groups: [2026, 12, 31]

Formula & Calculation Logic

Compiles your pattern directly with the native browser ECMAScript RegExp engine and guards against zero-length infinite loops.

Primary Formula

new RegExp(pattern, flags) → [...text.matchAll(re)]

Example: Match ISO dates with (\d{4})-(\d{2})-(\d{2})

  1. 1
    Compile regex with g flag
    /(\d{4})-(\d{2})-(\d{2})/g
    Valid RegExp
  2. 2
    Extract capture groups
    Group 1=Year, Group 2=Month, Group 3=Day
    2026, 11, 18

JavaScript Regular Expression Cheat Sheet

Most-used character classes, quantifiers, and anchors.

Showing 10 of 10 reference values
ECMAScript regex syntax quick reference
TokenMeaningExampleMatches
\d / \DDigit / Non-digit\d{4}2026
\w / \WWord char [A-Za-z0-9_]\w+hello_1
\s / \SWhitespace / Non-space\s+spaces, tabs
^ / $Start / End of line^https://URL prefix
* / + / ?0+, 1+, 0 or 1 timescolou?rcolor, colour
{m,n}Between m and n times[a-z]{2,4}com, org, info
(abc)Capturing group(\d+)-(\d+)Group 1 & Group 2
(?:abc)Non-capturing group(?:Mr|Ms)\.Mr., Ms.
(?=abc)Positive lookahead\d+(?=px)16 in 16px
\bWord boundary\bcat\bcat (not scatter)

Practical Real-World Use Cases

Form Validation & Log Parsing

Debug email, phone, semantic version, and server-log extraction patterns.

Search-and-Replace Refactoring

Verify capture groups before running bulk codebase replacements.

Regex Tester & Debugger – Frequently Asked Questions

What do the regex flags g, i, m, and s mean?
g = global (all matches), i = case-insensitive, m = multiline (^ and $ match line starts/ends), s = dotAll (. matches newlines).
What is the difference between .* and .*??
.* is greedy (matches as much text as possible), while .*? is lazy (stops at the earliest valid match).
How do I match a literal dot or question mark?
Escape regex metacharacters with a backslash: \. matches a literal period.
View all Developer Tools →