Regex Tester, Debugger & Explainer
Debug regular expressions in real time with live match highlighting, named capture group inspection, string replacement previews, token explanations, and ReDoS backtracking detection.
Regex Tester, Debugger & Explainer: the tool
engineering@deesu.devbilling+eu@acme-corp.co.ukHardening input validation, parsers, or security pipelines in production?
DEESU builds resilient backend APIs, high-throughput log pipelines, and security-audited validation layers for modern SaaS teams.
How it works
How JavaScript Regular Expressions Execute Under the Hood
Modern JavaScript engines like V8 (Chrome, Node.js, Cloudflare Workers) and JavaScriptCore execute regular expressions using an NFA (Nondeterministic Finite Automaton) backtracking engine called Irregexp. Unlike pure DFA engines such as RE2, a backtracking NFA supports powerful features including backreferences, named capture groups, and arbitrary lookbehind assertions.
Every time your pattern encounters an alternation (a|b) or a quantifier (+, *, {m,n}), the engine pushes a choice point onto an internal stack. If the remainder of the pattern fails to match later in the input string, the engine pops the stack and tries the next branch. Visual inspection of matches, capture indices, and individual tokens makes this execution model transparent so you can verify edge cases before shipping code to production.
Understanding ReDoS (Regular Expression Denial of Service)
Because backtracking engines exhaustively explore alternative paths on failing inputs, a poorly constructed regex can turn a 40-character HTTP header or form input into a multi-second CPU lockup. In single-threaded runtimes like Node.js or browser main threads, one malicious input string stalls every concurrent request.
Our built-in ReDoS auditor inspects your regular expression statically for the most common catastrophic backtracking structures used in real-world CVEs:
- Nested Quantifiers: Patterns like
(a+)+or([a-zA-Z0-9]+)*$create exponential O(2^n) backtracking when a trailing character fails to match. - Overlapping Alternations Under Repetition: Expressions like
(\w|[a-z])+allow the same character to match multiple branches, multiplying decision states. - Multiple Unbounded Wildcards: Adjacent
.*or.+clauses cause quadratic O(n^2) scans across long logs, stack traces, or untrusted HTML snippets. - Practical Mitigation: Replace greedy wildcards with mutually exclusive negated character classes (such as
[^/]+), enforce input length limits before calling.test(), and keep quantifiers flat.
Mastering Capture Groups, Lookarounds, and Replace Rules
Named capture groups ((?<year>\d{4})) dramatically improve code readability over fragile numeric indices ($1, $2). When refactoring strings with String.prototype.replace(), named tokens like $<year> remain stable even if you insert an extra group earlier in the pattern. Non-capturing groups ((?:...)) let you group alternations or quantifiers without polluting the match array.
Lookaheads ((?=...), (?!...)) and lookbehinds ((?<=...), (?<!...)) are zero-width assertions: they verify surrounding context without consuming characters into the matched slice. Password strength validators, currency formatters, and log redactors rely heavily on lookarounds to enforce multiple independent constraints in a single pass.
Choosing the Right Regex Flags for Production Code
Flags fundamentally alter how a regular expression scans text. Always include the u (Unicode) flag when validating international names, emoji, or user-generated text so surrogate pairs are treated as single code points instead of broken UTF-16 halves. Be careful with stateful /g regex instances stored in module scope: calling .test() repeatedly mutates regex.lastIndex, causing alternating false negatives unless you reset lastIndex = 0 or omit g for boolean checks.
Questions, answered
(\w+)+ or overlapping alternations inside a repeated group. Check the ReDoS Auditor tab in this tool to pinpoint the risky subpattern and replace it with a negated character class.$<groupName> syntax in your replacement string (for example $<day>/$<month>/$<year>). You can also use numbered references like $1 and $2, or $& to insert the entire matched substring.+?, *?, ??) match as few characters as possible. For example, <.+> matches from the first < to the very last >, while <.+?> stops at the first closing >.^ and $ only match the very beginning and end of the entire input string, and . does not match newline characters. Enabling /m makes ^ and $ match every line boundary, while /s allows . to match across line breaks.Related reading and help
Cloud & DevOpsRegex Performance & ReDoS Security in 2026: Preventing Catastrophic Backtracking in Node.js, Python & Go
Eliminate Regex Denial of Service (ReDoS) outages in 2026. Learn how NFA engines backtrack, audit vulnerable patterns, and migrate to RE2 linear-time regex.
Nov 18, 20269 min read
Cloud & DevOpsAI-Generated Code Security in 2026: Detecting Vulnerabilities, Slopsquatting & Automated Verification
Audit and secure AI-generated code in 2026. Learn how to catch hallucinated package exploits, IDOR authorization flaws, and build automated verification gates.
Nov 6, 20266 min read- Cloud & DevOps
The Node.js Release Schedule Is Changing: One LTS a Year, Starting Now
Node.js 26 hits Active LTS on October 28, 2026 — the last release under the old model. Here's what the new Node.js release schedule changes for you.
Oct 5, 20268 min read - DEESU serviceWeb DevelopmentWeb applications built to be found and built to convert — SEO-minded from the first commit, from storefronts to internal portals.See the service
More free tools
- Open Graph & social meta tag generatorGenerate and test Open Graph, Twitter Card, and SEO meta tags with live previews for Google, X, LinkedIn, and Facebook.
- Google Play & App Store fee calculatorCalculate your exact take-home payout, compare standard 15% vs 30% cuts, and test if external billing saves money.
- App cost calculatorEstimate a price range for an Android app or website from its features, in your local currency.
- Google Play launch checklistAn interactive checklist covering the store listing, policies, quality checks and release steps.
- Project brief generatorAnswer a few questions and get a clear, copyable brief you can send to any development team.
- App privacy policy generatorAnswer a few questions and get a plain-English privacy policy and a delete-account page for your Android or iOS app.
- App icon generatorUpload one image and download every Android, iOS and favicon size, with adaptive icon safe-zone checks.
- Play Store listing optimizerCheck your title, short and full description against keyword, readability and Google Play policy rules.
- LLM token & cost calculatorForecast production AI API expenses across OpenAI, Anthropic & DeepSeek. Model prompt caching savings and routing arbitrage.
- JWT debugger & security inspectorDecode, verify, and audit JSON Web Tokens for alg:none bypasses, key confusion attacks, expiry status and leaked secrets.
- Cron expression generator & explainerBuild, validate and translate crontab schedules for Linux, AWS EventBridge, GitHub Actions and Kubernetes.
- JSON to TypeScript & Zod converterInstantly convert raw API JSON payloads into clean TypeScript interfaces and production Zod v3 validation schemas.
- Docker Run to Docker Compose converterConvert raw docker run commands into production Docker Compose v2 YAML with automated security hardening and healthchecks.
- cURL to Code converter (Fetch, Axios, Python, Go)Translate cURL commands into JavaScript fetch, Axios, Python requests, Go, Rust, and Node.js with 100% in-browser privacy.
- SVG optimizer & React JSX converterMinify and clean vector SVGs, strip Figma metadata, and convert to production React JSX, React Native, or Vue components.
- JSON formatter, validator & diff viewerBeautify, validate, minify, sort keys, and compare two JSON payloads side by side with nested JSONPath diff inspection.
- SQL formatter & query linterBeautify PostgreSQL, MySQL, SQLite, and T-SQL queries and catch SELECT *, missing WHERE clauses, and slow non-sargable scans.
- CSS to Tailwind v4 converter & OKLCH paletteConvert raw CSS declarations to Tailwind v4 utility classes and generate accessible 50–950 OKLCH color scales with @theme export.
- Base64, URL, HTML & SHA-256 hash toolkitEncode/decode Base64 (UTF-8 & URL-safe), URLs, HTML entities, Hex, and generate SHA-256, SHA-512 & HMAC signatures offline.
- UUID v7, UUID v4, ULID & NanoID generatorBulk generate cryptographically secure RFC 9562 UUID v7, UUID v4, ULID, and custom NanoIDs and decode embedded timestamps.
- Linux chmod permissions calculatorCalculate Linux octal and symbolic file permissions (755, 644, 600), configure SetUID/SetGID/Sticky bits, and export chmod commands.
- Robots.txt generator & AI bot blockerBuild valid robots.txt rules, control GPTBot, ClaudeBot, and CCBot AI crawlers, declare sitemaps, and test URL paths live.
- CSP & HTTP security headers generatorGenerate strict Content-Security-Policy, HSTS, and Permissions-Policy configs for Next.js, Vercel, Nginx, Apache, and Cloudflare.
- Markdown table & GitHub README builderCreate formatted Markdown tables visually, import CSV/TSV spreadsheets, and build GitHub alert callouts and Shields.io badges.
Tell us what you're building.
Send the problem, not a polished brief. We'll tell you what it actually takes to ship it: stack, timeline and cost, before you commit to anything.