Understand any regular expression — breaks down patterns into plain English explanations token by token
^(?:+?1[-.●]?)?\(?([0-9]{3})\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})$ (a US phone number matcher) becomes impenetrable at first glance. The explainer breaks this down token by token — ^ explained as 'Start of string anchor', (?:...)? as 'Optional non-capturing group', [0-9]{3} as 'Exactly 3 digits' — making even complex patterns readable and learnable.^ $ \b \B), character classes ([a-z] [^0-9] \d \w \s and their inverses), quantifiers (* + ? {n} {n,} {n,m} — greedy, lazy, and possessive variants), groups (capturing (...), non-capturing (?:...), named (?<name>...), atomic (?>...)), lookarounds (positive/negative lookahead (?=...) (?!...) and lookbehind (?<=...) (?<!...)), alternation (|), backreferences (\1 \k<name>), and common escape sequences.g global, i case-insensitive, m multiline, s dotall, u unicode) which you can toggle to see how they affect matching behavior. All parsing runs locally in your browser using JavaScript's built-in regex engine — your patterns and test data never leave your device.The Regex Explainer accelerates regex learning through three complementary mechanisms that static documentation can't provide. First, <strong>just-in-time learning</strong> — instead of reading about regex features you might eventually need, you paste a pattern you're currently struggling with and get immediate, contextual explanations of exactly the features it uses. This is far more efficient than scanning reference tables. Second, <strong>pattern deconstruction</strong> — complex regexes are intimidating precisely because the syntax compresses so much meaning into so few characters; the explainer decompresses this density into human-readable descriptions, making the pattern's logic transparent. Third, <strong>verification feedback</strong> — reading an explanation alongside live match results confirms your understanding; if you think a token means one thing but the matches show another, you've found a learning opportunity. Studies in programming pedagogy show that 'explain and verify' cycles produce deeper understanding than passive reading. The PivaBox Regex Explainer provides this cycle for free, entirely in your browser.
Yes, the explainer explicitly distinguishes these three quantifier modes, which is one of the most common sources of regex bugs. <strong>Greedy quantifiers</strong> (<code>* + ? {n,m}</code>) match as much text as possible while still allowing the overall pattern to succeed — <code>a.*b</code> against 'a1b2b' matches the entire string because <code>.*</code> greedily consumes '1b2'. <strong>Lazy quantifiers</strong> (<code>*? +? ?? {n,m}?</code>) match as little as possible — <code>a.*?b</code> against 'a1b2b' matches only 'a1b' because <code>.*?</code> stops at the first <code>b</code>. <strong>Possessive quantifiers</strong> (<code>*+ ++ ?+ {n,m}+</code>) match as much as possible and never give back (no backtracking) — <code>a.*+b</code> against 'a1b2b' fails entirely because <code>.*+</code> consumes everything including both <code>b</code>s and refuses to backtrack. The explainer labels each quantifier with its greediness mode so you can understand and debug matching behavior. All parsing is client-side — your regex patterns remain private.
The explainer uses JavaScript's native regex engine for parsing and explanation, which covers the ECMAScript regex flavor. Most common regex features are consistent across languages — character classes, quantifiers, groups, anchors, and alternation work identically in JavaScript, Python, Java, PHP, Ruby, and Go. However, there are language-specific features the explainer may not fully interpret: <strong>Python</strong> — named groups use <code>(?P<name>...)</code> syntax (vs JavaScript's <code>(?<name>...)</code>), and Python supports <code>\A</code> and <code>\Z</code> anchors differently. <strong>Java</strong> — supports possessive quantifiers (<code>*+</code>) and atomic groups natively, and uses <code>\p{L}</code> for Unicode categories. <strong>PHP/PCRE</strong> — supports recursive patterns (<code>(?R)</code>), subroutines (<code>(?&name)</code>), and callouts. <strong>Ruby</strong> — uses <code>\p{Han}</code> for CJK scripts and has slightly different escape handling. For regexes from non-JavaScript languages, the explainer will still correctly parse and explain the shared features (95%+ of most patterns) — just be aware that language-specific extensions may not have detailed explanations. The PivaBox explainer is optimized for learning and understanding, not exhaustively covering every regex flavor's quirks.