--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: valid.js --- # Input ```jsx /^abc[a-zA-Z]/; /^abc/; /[\[]/; /[\]]/; /\[][\]]/; /[a-zA-Z\[]/; /[[]/; /[\[a-z[]]/; /[\-\[\]\/\{\}\(\)\*\+\?\.\\^\$\|]/g; /\s*:\s*/gim; /[\]]/uy; /[\]]/s; /[\]]/d; /\[]/; /[[^]]/v; /[[\]]]/v; /[[\[]]/v; /[a--b]/v; /[a&&b]/v; /[[a][b]]/v; /[\q{}]/v; /[[^]--\p{ASCII}]/v; /[\u200E\u2066-\u2069]/gu; ``` # Diagnostics ``` valid.js:15:3 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this negated empty character class. 13 │ /[\]]/d; 14 │ /\[]/; > 15 │ /[[^]]/v; │ ^^^ 16 │ /[[\]]]/v; 17 │ /[[\[]]/v; i Negated empty character classes match anything. If you want to match against [, escape it \[. Otherwise, remove the character class or fill it. ``` ``` valid.js:22:3 lint/correctness/noEmptyCharacterClassInRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The regular expression includes this negated empty character class. 20 │ /[[a][b]]/v; 21 │ /[\q{}]/v; > 22 │ /[[^]--\p{ASCII}]/v; │ ^^^ 23 │ /[\u200E\u2066-\u2069]/gu; i Negated empty character classes match anything. If you want to match against [, escape it \[. Otherwise, remove the character class or fill it. ```