perl-regex 0.11.0

Regex parsing and validation helpers for Perl syntax
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented0 out of 7 items with examples
  • Size
  • Source code size: 48.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.76 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • EffortlessMetrics/perl-lsp
    0 1 46
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • EffortlessSteven

perl-regex

Regex validation and safety analysis for Perl regular expression patterns.

Features

  • Nested quantifier detection -- heuristic detection of patterns like (a+)+ that risk catastrophic backtracking.
  • Embedded code detection -- identifies (?{...}) and (??{...}) constructs that execute arbitrary Perl code.
  • Complexity checking -- enforces limits on lookbehind nesting depth, branch reset nesting, Unicode property count, and branch count.
  • Offset-aware errors -- all diagnostics carry the source offset for IDE integration.

Public API

Type Purpose
RegexValidator Configurable validator with safety limits (nesting depth, Unicode properties)
RegexError Error type with source offset for syntax/security issues

Workspace Role

Tier 1 leaf crate in the tree-sitter-perl-rs workspace. Used by parse-time validation logic to flag risky regex patterns for LSP diagnostics.

License

MIT OR Apache-2.0