Regular Expressions - Match Beginning String Patterns

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

Your code so far
Is this a case of it looks for Cal at the beginning of any word or just that it makes a mistake thinking I did not use a capital C?
Thanks

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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.64

Challenge: Regular Expressions - Match Beginning String Patterns

Link to the challenge:

You don’t need to include parentheses. Whilst technically including the parentheses still allows ‘Cal’ to be found, it’s failing the FCC test. Look at the example given in the challenge description.

1 Like

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