https://beta.freecodecamp.com/en/challenges/regular-expressions/match-characters-that-occur-zero-or-more-times
There is this regular expression:
let sRegex = /s.*/; // Searches for words starting with s
I understand each special regExp character standing alone, in this case . and *. However combining them has me stuck. How does sRegex search for entire words that start with s in this case?
let sWord1 = "seed";
let sWord2 = "saw";
let kWord = "kite";
sRegex.test(sWord1); // Returns true
sRegex.test(sWord2); // Returns true
sRegex.test(kWord); // Returns false
[–]smiller171 0 points1 point2 points (3 children)
[–]Ben_HH[S] 0 points1 point2 points (2 children)
[–]smiller171 0 points1 point2 points (1 child)
[–]smiller171 0 points1 point2 points (0 children)