Interactive Regex Cheat Sheet • ReDoS Protected Sandbox

Regex Tester, Match Inspector & Interactive Cheat Sheet

Test, validate, and debug ECMAScript regular expressions in real-time while referencing our complete Regex Cheat Sheet. 100ms ReDoS worker timeout defense and 1-click testable patterns.

How Does a Regular Expression (Regex) Match Strings?

A regular expression (regex) parses text using literal characters, character classes (\d for digits, \w for words), quantifiers (+ for 1+, * for 0+, {min,max}), anchors (^ for start, $ for end), and capture groups ((group)). Evaluated against ECMAScript standards with flags like 'g' (global) and 'i' (case-insensitive), regex locates patterns efficiently. DevOmniTools tests regex 100% client-side in an isolated Web Worker with a strict 100ms timeout to prevent ReDoS catastrophic backtracking.

Client-Side Web Worker Thread • 0 Server Calls • Instant ReDoS Terminate
Share on WhatsApp
0 matches 0.00 ms
/ / g
Expression Flags:
Common Patterns & Quick Presets 1-click insert
Test String Canvas 0 chars
Live Visual Highlighting
No matches found. Enter a valid pattern and test string above.

Detailed Match Table & Capture Groups

0 matches extracted
#PositionFull MatchCapture Groups
No matches found. Enter a valid pattern and test string above.
Core tools process input locally. Optional AI sends the selected snippet through Cloudflare to Cloudflare AI or the optional Google Gemini fallback after consent; provider retention policies apply. Contact submissions send your details to our email provider. Offline use requires the page and its assets to finish caching; external AI and contact delivery require internet. 100ms ReDoS Catastrophic Backtracking Guard
Isolated Worker Thread Active
QUICK SYNTAX REFERENCE

Interactive Regex Cheat Sheet & Quick Reference

Quickly look up regular expression syntax, metacharacters, quantifiers, lookaheads, and copy production-ready patterns.

SyntaxMeaning & BehaviorExample
.Any character except newline (\n)a.c matches abc, a-c
\dAny digit [0-9]\d{3} matches 123
\DAny non-digit character [^0-9]\D+ matches ABC
\wWord character (alphanumeric + underscore) [a-zA-Z0-9_]\w+ matches user_123
\WNon-word character [^a-zA-Z0-9_]\W matches @, !, #
\sWhitespace character (space, tab, newline)hello\sworld
\SNon-whitespace character\S+ matches Word
[abc]Any character within the brackets (a, b, or c)[aeiou] matches vowels
[^abc]Any character NOT within the brackets[^0-9] matches non-digits
[a-z]Any lowercase letter in range a to z[a-z]+ matches word
Frequently Asked Questions (FAQ) · Regex Tester & Debugger Online — ReDoS-Safe Sandbox

Complete Guide to Regular Expressions, Capture Groups & ReDoS Defense

Test regular expressions in real-time, extract named capture groups, and prevent browser freezes with built-in ReDoS protection.

MU
IBM Maximo & Developer Tools Architect
Technical Reference

01. How Regular Expressions Work in Plain English

A regular expression (regex) is a pattern used to find, match, or replace text. Developers use regex daily to validate emails, parse server logs, and clean user inputs.

A pattern combines normal letters with special character symbols: `\d` matches numbers, `\w` matches letters, `\s` matches spaces, and `^` or `$` anchor matches to the start or end of text.

You can use parentheses `(pattern)` to capture specific pieces of matching text, like extracting the username and domain from an email address.

  • Real-time visual syntax highlighting and group indexing.
  • Supports standard flags: 'g' (global), 'i' (ignore case), and 'm' (multiline).
  • Pre-built cheat sheet for emails, phone numbers, URLs, and IP addresses.
Quick Example: Email Matching with Groups

Pattern: ^([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$ Test Text: username@example.com Match Result: Full Match = username@example.com, Group 1 = username, Group 2 = example.com

02. Greedy vs Lazy Matching Explained

• Greedy Matching (* and +): By default, quantifiers match as many characters as possible. For example, `/<.*>/` applied to `&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;` matches the entire text from start to finish.

• Lazy Matching (*? and +?): Adding a question mark forces the pattern to match as few characters as possible. `/<.*?>/` matches only the first `&lt;div&gt;` tag.

Understanding this difference helps you prevent bugs where your pattern accidentally captures too much text.

03. How DevOmniTools Prevents ReDoS Freezes

Some nested regex patterns (such as `(a+)+$`) can get stuck in infinite loops on certain inputs. This is called Catastrophic Backtracking or ReDoS.

Most online tools freeze your browser tab when this happens. DevOmniTools runs all regex testing inside an isolated Web Worker thread. If execution takes longer than 100ms, the worker stops automatically to keep your computer responsive.

04. Common Regex Workflows & Integrated Tools

• URL Permalinks: Convert matched strings into clean slugs with our URL Slug Generator.

• Payload Extraction: Format and validate JSON extracted via regex using the JSON Formatter & Validator.

• Text Metrics: Inspect character and word counts with our Word & Character Counter.

Frequently Asked Questions (FAQ)

How does DevOmniTools prevent browser freezing on unsafe regex patterns?

Every regular expression is executed inside an isolated Web Worker thread. If evaluation exceeds 100ms due to catastrophic backtracking (ReDoS), the worker is instantly terminated and an alert is rendered without locking up the UI.

What ECMAScript flags are supported and what do they do?

DevOmniTools supports all standard flags: "g" (global search for all occurrences), "i" (case-insensitive matching), "m" (multiline anchors ^ and $), "s" (dotAll - "." matches newlines), and "u" (unicode codepoint aware).

What is Catastrophic Backtracking (ReDoS)?

Catastrophic Backtracking occurs in NFA regex engines when nested ambiguous quantifiers like (a+)+ or (x|x)* fail to match an input string, forcing the engine to test an exponential 2^n branches and freezing the CPU. DevOmniTools protects against this via thread timeouts.

What is the difference between greedy and lazy quantifiers?

Greedy quantifiers (*, +, {n,}) match as many characters as possible before backtracking. Adding a question mark (*?, +?, {n,}?) makes them lazy, matching as few characters as possible.

Is my test string or regular expression uploaded to any server?

No. All compilation, execution, capture group extraction, and visual highlighting are computed 100% locally within your browser's client-side memory.

Can I use Regex Tester & Debugger Online — ReDoS-Safe Sandbox offline without an active internet connection?

Offline use requires the page and its tool assets to finish caching first. Core transformations can then run locally; optional AI and contact delivery require internet.

Is Regex Tester & Debugger Online — ReDoS-Safe Sandbox free to use with any rate limits or paywalls?

Core tools are free to use without an account. Device memory and tool-specific safety limits apply. Optional AI and online contact services have usage limits.

More free tools that run safely in your web browser.

Explore the tool directory