ARCHOS 525 BLUEPRINT · /d/dgm_code-regex-and-parser-backtracking
Regex Engines, Parser Backtracking & ReDoS Prevention (RE2 / NFA vs DFA)
6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_code-regex-and-parser-backtracking) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-regex-and-parser-backtracking)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-regex-and-parser-backtracking" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Regex Engines, Parser Backtracking & ReDoS Prevention (RE2 / NFA vs DFA) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR client_0["Untrusted Input String"] n1_1["Syntax & AST Compiler"] n2a_2["Thompson NFA / RE2"] n2b_3["Backtracking Guard"] n3_4["Safe Match / AST"] downstream_5["Downstream & OTel"] client_0 -->|"1. Compile · AST"| n1_1 n1_1 -->|"2a. Step · Linear"| n2a_2 n1_1 -->|"2b. Lint ReDoS · Check"| n2b_3 n2a_2 -->|"3a. Emit match · ON"| n3_4 n2b_3 -->|"3b. Merge · RAM"| n3_4 n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5
COMPONENT STACK (6)
- Untrusted Input StringSTATELESSUser Regex / Log / URL
- Syntax & AST CompilerSTATELESSCompiles pattern -> NFA/DFA
- Thompson NFA / RE2STATELESSParallel active states · O
- Backtracking GuardSTATELESSWarns on nested quantifiers +
- Safe Match / ASTSTATELESSBounded O parse zero CPU hang
- Downstream & OTelSTATELESSConsumers, metrics & SLOs
REQUEST & DATA FLOW (6)
- Untrusted Input String → Syntax & AST Compiler (Compile)[AST]
- Syntax & AST Compiler → Thompson NFA / RE2 (Step)[Linear]
- Syntax & AST Compiler → Backtracking Guard (Lint ReDoS)[Check]
- Thompson NFA / RE2 → Safe Match / AST (Emit match)[ON]
- Backtracking Guard → Safe Match / AST (Merge)[RAM]
- Safe Match / AST → Downstream & OTel (Emit /)[OTLP/API]