1.9 KiB
1.9 KiB
id, title, challengeType
| id | title | challengeType |
|---|---|---|
| 587d7db6367417b2b2512b98 | Match Single Characters Not Specified | 1 |
Description
negated character sets.
To create a negated character set, you place a caret character (^) after the opening bracket and before the characters you do not want to match.
For example, /[^aeiou]/gi matches all characters that are not a vowel. Note that characters like ., !, [, @, / and white space are matched - the negated vowel character set only excludes the vowel characters.
Instructions
Tests
tests:
- text: Your regex <code>myRegex</code> should match 9 items.
testString: 'assert(result.length == 9, "Your regex <code>myRegex</code> should match 9 items.");'
- text: Your regex <code>myRegex</code> should use the global flag.
testString: 'assert(myRegex.flags.match(/g/).length == 1, "Your regex <code>myRegex</code> should use the global flag.");'
- text: Your regex <code>myRegex</code> should use the case insensitive flag.
testString: 'assert(myRegex.flags.match(/i/).length == 1, "Your regex <code>myRegex</code> should use the case insensitive flag.");'
Challenge Seed
let quoteSample = "3 blind mice.";
let myRegex = /change/; // Change this line
let result = myRegex; // Change this line
Solution
// solution required