Skip to content

fix: correct repeated capture ranges - #201

Merged
vycdev merged 2 commits into
vycdev:developfrom
vycdev2:fix/last-capture-range-1786319176
Aug 10, 2026
Merged

fix: correct repeated capture ranges#201
vycdev merged 2 commits into
vycdev:developfrom
vycdev2:fix/last-capture-range-1786319176

Conversation

@vycdev2

@vycdev2 vycdev2 commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • Correct the range calculation used for the final non-empty regex capture when that capture text also appears earlier in the full match.
  • Replace the unsupported typed lodash findLast call with an equivalent native reverse search so the focused regression runs through the repository's normal test path.
  • Add a focused regression test and changelog entry.

Verification

  • RED on untouched upstream/develop: TS_NODE_TRANSPILE_ONLY=1 npx mocha --no-config -r ts-node/register test/regex.spec.ts --exit — 1 failing assertion ({ start: 0, end: 3 } vs. { start: 3, end: 6 }).
  • GREEN focused test: same command — 1 passing.
  • npm install — passed; npm reported deprecation warnings and 30 audit vulnerabilities (9 low, 7 moderate, 11 high, 3 critical).
  • npm test — passed (135 tests).
  • npm run compile — passed.
  • npm run format:check — passed.
  • git diff --check — passed.

Risk

  • Low: only regex capture-range selection changes; existing behavior keeps using the final non-empty capture, but now locates its final occurrence reliably.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

@vycdev
vycdev merged commit b33ac42 into vycdev:develop Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants