Explore 12 Tools
Code · Pattern Matching

Regex Tester, Debugger & Pattern Library

Test JavaScript regular expressions in real time with capture group inspection, live string replacement, and plain-English token explanations.

1 · Regular Expression Pattern & Test Corpus

Common Pattern Presets

2 · Match Inspector, Capture Groups & Explanation

Privacy & Security Notice: 100% of your inputs in the Regex Tester, Debugger & Pattern Library are processed locally inside your browser. Zero data is uploaded to any server.

How to Test & Debug Regular Expressions

Enter your regular expression pattern and flags (such as gm or gi), paste sample text into the test corpus, and optionally provide a replacement template using $1, $2 capture group references. The inspector lists every match index, extracted capture group, plain-English token explanation, and live replacement output.

Key Features & Capabilities

  • Evaluate ECMAScript regular expressions with g, i, m, s, u, and y flags against multi-line test corpuses
  • Inspect match indices and numbered capturing groups alongside live replacement previews
  • Read automated plain-English explanations of anchors, character classes, groups, and quantifiers
  • Load battle-tested presets for emails, HTTPS URLs, IPv4 addresses, ISO dates, and semantic versions

Mastering ECMAScript Regular Expressions & Capture Groups

Regular expressions provide a concise declarative language for validating user input, scraping structured tokens from unstructured logs, and executing complex search-and-replace refactorings across codebases. Testing edge cases interactively prevents catastrophic backtracking and false positives before deploying validation rules to production.

Essential Regular Expression Tokens, Quantifiers & Flags Cheat Sheet
Token / FlagCategoryBehavior & MeaningExample Pattern
^ and $AnchorsMatch start and end of string (or line when m flag is active)^\d{4}-\d{2}-\d{2}$
\d, \w, \sCharacter ClassesDigit [0-9], word char [A-Za-z0-9_], or whitespace\w+@\w+\.\w+
+, *, ?, {n,m}Quantifiers1+, 0+, 0 or 1, or between n and m repetitionshttps?:\/\/
(...) vs (?:...)GroupsNumbered capturing group ($1) vs non-capturing group(\d{3})-(?:\d{4})
g, i, m, uRegExp FlagsGlobal (all matches), Case-insensitive, Multiline, Unicode/pattern/gmu

Avoiding Catastrophic Backtracking (ReDoS)

Nested quantifiers—such as (a+)+ or overlapping wildcard groups like (.*a){10}—can cause exponential execution time when evaluated against non-matching strings, leading to Regular Expression Denial of Service (ReDoS). Prefer specific character classes (like [^"\r\n]+) over greedy dot-star (.*) patterns whenever possible.

Frequently Asked Questions

Why does my regex only return the first match?

Make sure the global flag ("g") is included in the Flags input field. Without "g", RegExp.prototype.exec() stops after finding the first match.

How do I use capture groups in the Replacement String field?

Wrap the part of your pattern you want to extract in parentheses (...) and reference it in the replacement field as $1, $2, etc. For example, matching (\w+)@(\w+\.\w+) with replacement "[REDACTED@$2]" masks usernames while keeping the domain.

What does the "m" (multiline) flag change?

By default, ^ and $ match only the very start and end of the entire text box. Adding the "m" flag makes ^ and $ match the start and end of every individual line.

Explore the Suite

More Free Browser Utilities

View all 12 tools →
Design · Accessibility

APCA Color Contrast Checker

Check perceptual APCA Lc and WCAG 2.x contrast ratios, simulate color blindness, auto-fix accessible shades, and export design tokens.

Launch utility
AI · Engineering

LLM Token Cost Calculator

Compare API token pricing across 23+ frontier LLMs, model prompt caching savings, estimate token counts, and export CSV budgets.

Launch utility
Video · Social

Video Safe Zone Checker

Preview TikTok, Instagram Reels, YouTube Shorts, Snapchat, and LinkedIn vertical safe zones on your 9:16 frames with PNG export.

Launch utility
SEO · Structured Data

Schema.org JSON-LD Generator

Generate validated JSON-LD structured data for 17 Schema.org entity types with 1-click presets and live Google SERP previews.

Launch utility
Content · Localization

Multilingual Lorem Ipsum Generator

Generate synthetic layout filler in 10 languages and developer vocabularies, with RTL script support and HTML/Markdown wrapping.

Launch utility
Text · Dev Formatting

Text Case & Code Identifier Converter

Convert text across 15 programming and editorial cases with bulk find-and-replace, line wrapping, deduplication, and reading stats.

Launch utility
SEO · Social Sharing

Open Graph & SEO Meta Tag Generator

Build complete HTML head metadata, Open Graph tags, and X/Twitter Cards with live SERP truncation audits and social card previews.

Launch utility
Code · Data Engineering

JSON Formatter, Validator & TS Converter

Prettify, validate, and minify JSON payloads, sort object keys deterministically, and convert JSON into TypeScript interfaces or CSV.

Launch utility
Design · Modern UI

CSS Gradient & Glassmorphism Studio

Design linear, radial, and conic CSS gradients paired with frosted-glass backdrop filters, live interactive preview cards, and CSS export.

Launch utility
Security · Cryptography

SHA Hash, UUID v4 & Password Generator

Generate cryptographic SHA-1/256/384/512 digests, bulk RFC 4122 UUID v4 identifiers, and high-entropy passwords via Web Crypto API.

Launch utility
Security · Web Encoding

Base64, JWT Decoder & URL/HTML Encoder

Encode and decode UTF-8 Base64 strings, URL components, HTML entities, and inspect JSON Web Token (JWT) headers and payloads offline.

Launch utility