the arr should have the value “Cal and Ricky both like racing.”…but is having only “C” .
why?

Because you specified the ^ at the beginning, your current regular expression is only going to match a single letter which at the beginning of the string. The first letter is “C”. What is the actual requirement for the regular expression? You said it should match the entire sentence in rickyAndCal, but what should it not match?

Using the string “Cal and Ricky both like racing.”, they both would have “Cal” in the array, because in the first regex (below), It will match any single letter at the beginning of the string followed immediately by “al”. The “C” is a single letter at the beginning of the string, so “Cal” is matched.

let calRegex = /^[a-z]al/gi; // Change this line

In the second regex (below), it will only match “Cal” if these are the first three letters of the string.

let calRegex = /^Cal/; // Change this line

One notable difference between the two regular expressions is the first one would also match “cal” (lower case “c” because of the i flag). the second regex will not match “cal”, because you do not use the i flag.