Back to Explore

fent/ret.js

GitHub
1 watchersOpen 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 repository appears largely inactive, with the last upstream push on 2026-01-24 and the most recent published update listed as v0.5.0 on 2023-03-16, suggesting this source is quiet or in maintenance mode rather than actively evolving.
  • There is no frequent update/release cadence evident from the available history, with multi-year gaps between v0.5.0 (2023) and earlier updates (2022, 2021, 2019).

AI summary generated

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

Recent updates

  • 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.