You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some regular expressions, which contain “-”, fail in “v” mode #520
// File: test.js// Using QuickJS 2026-06-04.constre=/-/v;console.log(re.test("3-4"));
When it is executed in console using qjs.exe test.js, it gives SyntaxError: invalid character in class in regular expression at the definition of re.
If the “v” flag is removed, then it works.
The definition const re = RegExp( "-", "v") fails too.
Even if this example does not require the “v” flag, it should not fail. The problem can be reproduced with other examples, where “v” is required and which also contain “-”. (For example, this fails: const re = /-[[a-z]--[c]]/v; this works: const re = /[[a-z]--[c]]/v).
The issue is not observed in other engines that supports “v” mode.
Activity
fixed regexp unicode set parsing (#520)
bellard commentedon Sep 26, 2026
Fixed
port upstream a479eff: fixed regexp unicode set parsing (bellard#520)
upstream a479eff: PORT - fixed regexp unicode set parsing (bellard#520)
fixed regexp unicode set parsing (bellard#520)