Skip to content

fix: avoid regex anchors for whole-string checks - #3

Merged
m00qek merged 2 commits into
mainfrom
fix/regex-newline-anchoring
Nov 19, 2026
Merged

m00qek merged 2 commits into
mainfrom
fix/regex-newline-anchoring

Conversation

@m00qek

@m00qek m00qek commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

libucode 2026.07.09 (upstream 8a8b4d12), which every 25.12 package index now serves, makes ^/$ match per line and stops ./[^...] matching \n. As a result, anchored /^...$/ checks accepted values whose first or last line was valid. For example, -r $'json\nx' silently ran the detailed reporter. The s flag flipped meaning too, so no regex flag works the same on both engines.

  • Use util.full_match(), util.dirname() and substr() instead of anchored regexes.
  • The fs.glob mock now lets wildcards match \n and requires the whole path to match.
  • Add a newline fixture and CLI checks, plus make meta-test-new-engine, which also runs as a required CI job.

Both engines pass the meta-test, 705 PASS each.

libucode 2026.07.09 makes ^/$ per-line and stops [^...] matching '\n', so
/^...$/ accepted "json\nx" for -r and similar elsewhere. Use full_match(),
dirname() and substr() instead; fs.glob mock now matches '\n' in wildcards.
@m00qek
m00qek merged commit 75d2724 into main Nov 19, 2026
4 checks passed
@m00qek
m00qek deleted the fix/regex-newline-anchoring branch November 19, 2026 23:04
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