Some v-mode regexes are marked invalid when actually valid, such as a character class subtracted from a bare Unicode property character class.
Lint Name
no-invalid-regexp
Code Snippet
// Lint error "Invalid RegExp literal: Rework regular expression to be a valid deno-lint(no-invalid-regexp)"
const re = /[\p{N}--0]/gv;
// works fine at runtime, logging ['1', '2', '3'] as expected
console.log('1203'.match(re));
// identical semantics and runtime behavior, redundant brackets around unicode property eliminate the lint error
const re2 = /[[\p{N}]--0]/gv;
Expected Result
No lint error for regexes like /[\p{N}--0]/gv
Actual Result
Lint error
Additional Info
N/A
Version
deno 2.3.3 (stable, release, x86_64-unknown-linux-gnu)
v8 13.7.152.6-rusty
typescript 5.8.3
Some
v-mode regexes are marked invalid when actually valid, such as a character class subtracted from a bare Unicode property character class.Lint Name
no-invalid-regexpCode Snippet
Expected Result
No lint error for regexes like
/[\p{N}--0]/gvActual Result
Lint error
Additional Info
N/A
Version
deno 2.3.3 (stable, release, x86_64-unknown-linux-gnu)
v8 13.7.152.6-rusty
typescript 5.8.3