Back to Explore

fent/ret.js

GitHub
3 updates · last 90 daysOpen source

Last release:

A Node.js JavaScript library that tokenizes strings that represent regular expressions into a structured token format (including roots, groups, character sets, ranges, repetitions, and positions). It is useful for analyzing a regex string or converting it into tokens that can later be used to reconstruct parts of the original pattern.

Project status

  • The source is currently active, with updates on October 17, 25, and 30, 2026, and an upstream push on October 30.
  • The recent updates are clustered rather than evidence of a regular cadence. Before this burst, the listed updates jump from March 2023 to October 2026, a long quiet period.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v0.6.1

    v0.6.1 fixes regular-expression tokenization so escaped characters cannot be mistaken for group syntax. The diff also changes capture-group-name handling and error-location reporting, and updates development tooling dependencies.

  • v0.6.0

    v0.6.0 adds support for scoped `i`, `m`, and `s` group modifiers, including token representation and reconstruction. The diff also updates test tooling, adds source-position tracking for decoded characters, and restricts GitHub Actions workflow permissions. No breaking changes to the documented public API are apparent.

    SecurityFeatures
  • v0.5.1

    v0.5.1 is primarily described as a TypeScript types refinement and corresponding function signature adjustments. The code diff also shows additional runtime and developer-experience changes, including modifications around tokenizer error handling and a tooling/testing migration (vows to mocha).

    Breaking
  • v0.5.0

    v0.5.0 adds support for named capture groups in the regex tokenizer and reconstruction logic. The implementation introduces a new optional token field, `name`, and parses `(?<name>...)` group syntax with validation for valid identifier characters.

    Features
  • v0.4.3

    v0.4.3 is presented as a small bug-fix release focused on RegExp parsing edge cases, specifically handling invalid patterns at the end of the input. The diff shows a new tokenizer error for a trailing backslash and an additional safety check in digit parsing, plus corresponding test coverage.

  • v0.4.2

    v0.4.2 is a small bug fix release. It corrects how the tokenizer interprets numeric reference values that represent octal character codes.

  • v0.4.1

    v0.4.1 is presented as a bug fix for backreferencing when the reference number is greater than 10. The code diff shows substantial tokenizer logic added to handle multi-digit backreferences and to rewrite references into character tokens when there are insufficient capturing groups.

  • v0.4.0

    v0.4.0 introduces token reconstruction support, allowing regular expressions (or parts of them) to be generated back from the token structures produced by this library. The release notes only mention adding an interface, but the codebase adds a full reconstruct implementation, new set-lookup logic, and new exports.

    Features
  • v0.3.2

    v0.3.2 release notes only mention a bug fix for parsing class ranges that include square brackets and backslashes. The actual code diff, however, shows a much larger refactor, including a TypeScript migration and packaging changes (lib -> dist) that are not described in the release notes.

  • v0.3.0

    Release v0.3.0 primarily introduces TypeScript typings and expands documentation in the README with detailed examples and supported regex syntax notes. The code diff provided does not show any runtime logic changes in the parser itself.

    Features
  • v0.2.2

    This release focuses on a single bug fix related to parsing or handling regular expression character classes. It specifically corrects how whitespace characters are handled within character class definitions.