Skip to content

fix(pluginutils): avoid escaping hyphens in Unicode regexes - #172

Merged
sapphi-red merged 1 commit into
rolldown:mainfrom
btea:fix/pluginutils-unicode-regex-hyphen
Nov 9, 2026
Merged

sapphi-red merged 1 commit into
rolldown:mainfrom
btea:fix/pluginutils-unicode-regex-hyphen

Conversation

@btea

@btea btea commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

A hyphen outside a character class is already literal. Escaping it as \- causes RegExp construction to fail when the u flag is used. Leave hyphens unescaped and add regression tests for exactRegex, prefixRegex, and wordRegex.

@sapphi-red
sapphi-red merged commit 48f49ff into rolldown:main Nov 9, 2026
17 checks passed
@btea
btea deleted the fix/pluginutils-unicode-regex-hyphen branch November 9, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants