Skip to content

Harden regex execution and add regression tests - #1

Merged
ItsWanheda merged 28 commits into
mainfrom
fix/regex-regression-hardening
Oct 22, 2026
Merged

ItsWanheda merged 28 commits into
mainfrom
fix/regex-regression-hardening

Conversation

@ItsWanheda

@ItsWanheda ItsWanheda commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR hardens the existing vanilla JS Regex Pro app without adding runtime dependencies.

Fixes

  • Correct capture-group offsets and match data used in highlighting, match details, and export.
  • Advance zero-width Unicode matches correctly.
  • Validate flag uniqueness and unsupported combinations; expose the d and v flags.
  • Run matching, replacement, and split in a Web Worker with timeout termination and a manual Stop control.
  • Bound pattern, input, replacement, match, split, and favorite-list sizes.
  • Estimate expanded replacement output, including capture/prefix/suffix substitutions, before constructing large results.
  • Report truncated matches and reject replacement operations that exceed the safety cap.
  • Normalize stored history/favorites and validate restored values.
  • Fix file upload/drop handling and history removal.
  • Avoid repeated text-statistics allocations.

Tests and docs

  • Add 12 dependency-free Node regression tests.
  • Add GitHub Actions CI and syntax checks for browser scripts.
  • Update README, changelog, and the regression checklist at docs/REGRESSION_CHECKLIST.md.

Validation

  • Latest CI: 12 tests passed, 0 failed.
  • GitHub Actions: latest run.
  • Browser/manual QA is still recommended, especially across browsers that do not support the v flag or RegExp indices.

Uses a separate branch; main has not been changed by this PR.

@ItsWanheda
ItsWanheda merged commit 7c07ecc into main Oct 22, 2026
2 checks passed
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.

1 participant