2018-09-30 23:01:58 +01:00
---
id: 587d7db6367417b2b2512b98
title: Match Single Characters Not Specified
challengeType: 1
2019-08-05 09:17:33 -07:00
forumTopicId: 301358
2021-01-13 03:31:00 +01:00
dashedName: match-single-characters-not-specified
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2019-10-27 15:45:37 -01:00
So far, you have created a set of characters that you want to match, but you could also create a set of characters that you do not want to match. These types of character sets are called < dfn > negated character sets< / dfn > .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
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--
2018-09-30 23:01:58 +01:00
Create a single regex that matches all characters that are not a number or a vowel. Remember to include the appropriate flags in the regex.
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
Your regex `myRegex` should match 9 items.
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
assert(result.length == 9);
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
Your regex `myRegex` should use the global flag.
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
assert(myRegex.flags.match(/g/).length == 1);
```
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
Your regex `myRegex` should use the case insensitive flag.
2018-09-30 23:01:58 +01:00
```js
2020-11-27 19:02:05 +01:00
assert(myRegex.flags.match(/i/).length == 1);
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --seed--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
## --seed-contents--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
let quoteSample = "3 blind mice.";
let myRegex = /change/; // Change this line
let result = myRegex; // Change this line
```
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
2019-05-03 03:05:26 -07:00
let quoteSample = "3 blind mice.";
let myRegex = /[^0-9aeiou]/gi; // Change this line
let result = quoteSample.match(myRegex); // Change this line
2018-09-30 23:01:58 +01:00
```