Regular Expressions - Match Single Characters Not Specified

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

let quoteSample = "3 blind mice.";
let myRegex = /[^aeiou^0-9]/gi; // Change this line
let result = quoteSample.match(myRegex); // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Challenge: Regular Expressions - Match Single Characters Not Specified

Link to the challenge:

I know that this code is right, what i wish to know is why other stuff that i tried doesn’t

Like [^a-u0-9]
or [^a-u^0-9]

Thanks

The problem is with ^a-u – what does a-u represent in a regular expression?

1 Like

have a look at the output and see what different regex are doing:

console.log(result)

maybe try on the string 'abcd...xyz' etc

1 Like

I got it with your answer on my other topic.
Thank you very much

Truly a good way to understand my mistake. Thank you

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.