JavaScript Regular Expression (Regex) Tester

Test and debug JavaScript regular expressions in real-time. Features live syntax highlighting, capture group inspection, flag modifiers, and a built-in library of common pattern templates.

Quick Pattern Presets:
//
Match Highlights2 matches found
Contact support@opensourcetools.online or dev-team@example.com for help with SEO audits.
Capture Groups Breakdown:
Match #1: support@opensourcetools.online (pos 8)
Group 1: support
Group 2: opensourcetools.online
Match #2: dev-team@example.com (pos 42)
Group 1: dev-team
Group 2: example.com

ECMAScript Regular Expression Engine Standards

Regular Expressions (Regex) provide standardized pattern-matching syntax for string validation, lexical token parsing, and text extraction defined under the ECMA-262 ECMAScript standard.

Standard Regex Modifier Flags

  • g (Global Match): Continues scanning throughout the entire target string rather than terminating after the first match.
  • i (Ignore Case): Disables case sensitivity (e.g. /a/i matches both a and A).
  • m (Multiline): Changes anchors ^ and $ to match the start and end of every line rather than the start and end of the entire string.
  • s (dotAll): Allows the dot (.) wildcard to match newline characters (\n).
  • u (Unicode): Treats the pattern as a sequence of full Unicode code points.

Mitigating ReDoS (Catastrophic Backtracking)

Regular Expression Denial of Service (ReDoS) occurs when nested quantifiers (e.g. (a+)+$) cause exponential computational complexity ($O(2^n)$) on non-matching strings, causing web server CPU starvation. Always avoid overlapping greedy quantifiers.

Synergies with Developer & Data Tools

Integrate regex pattern matching with our full developer toolkit:

Frequently Asked Questions

What is the difference between capturing and non-capturing groups?

Capturing groups (abc) store the matched substring in memory for backreferences and array exports. Non-capturing groups (?:abc) group tokens for quantification without memory overhead.

How do lookaheads work in JavaScript regex?

Positive lookaheads (?=pattern) assert that what follows immediately matches the pattern without consuming characters in the match result.