Tell us what’s happening:
Describe your issue in detail here.
Hm… this is supposed to test the beginning of a string pattern.
I was curious about this so I went back to the original lesson on carets titled, " Match Single Characters Not Specified". I changed that code to the following code and expected “false” because what I tested for was NOT at the beginning of the string pattern. It returned “true”. How!? When it should return “false” since it is not at the beginning.
My code for the current lesson
let rickyAndCal = "Cal and Ricky both like racing."; let calRegex = /^Cal/; // Change this line let result = calRegex.test(rickyAndCal); console.log(result);
Your browser information:
User Agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.96.36.199 Safari/537.36
Challenge: Regular Expressions - Match Beginning String Patterns
Link to the challenge:
My code attempting to test this from the first caret lesson
let quoteSample = "3 blind mice."; let myRegex = /[^blind]/; // Change this line let result = myRegex.test(quoteSample); console.log(result);// Change this line