escapeRegex function ✓ 100.0%

Last updated: 2026-03-02T15:32:34.984Z

Metrics

LOC: 3 Complexity: 1 Params: 1 Coverage: 100.0% (1/1 lines, 12x executed)

Signature

escapeRegex(s: string): : string

Source Code

function escapeRegex(s: string): string {
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}

No outgoing dependencies.

Impact (Incoming)

graph LR escapeRegex["escapeRegex"] matchesRule["matchesRule"] matchesRule -->|calls| escapeRegex style escapeRegex fill:#dbeafe,stroke:#2563eb,stroke-width:2px click escapeRegex "f946f576c045998d.html" click matchesRule "1a959a10048b5e94.html"
SourceType
matchesRule calls