I’m trying to learn from reading Mozilla documentation for regular expressions, but there’s one thing I don’t get. For the special character \s it gives the following example
/\s\w*/ matches ‘ bar’ in “foo bar.”
I understand that \s is the special character for white space, but why is there a w* in the example?
doesn’t /\s/ also match ‘ bar’ in “foo bar.”?
What’s with the w*?
/\s\w*/is whitespace character followed by 0 or more word characters./\s/would only find the whitespace in the example.