Why does this regexp test return true

Why does this regexp test return true
0

#1

hey campers,

if anyone could explain this it would be much appreciated

// regex to return true if a string has a whitespace character 
// followed by a dot, comma, colon, or semicolon

console.log(/\s(.|,|:|;)/.test(" hi"));

thank you very very much


#2

. is a special symbol that matches any character


#3

oh wow, what a legend - thank you!


#4

https://regex101.com/ is your friend.