How does the regex \s* work?

Mahmoud.Sayed7217
Mahmoud.Sayed7217 Posts: 2 🌱
edited November 2022 in Customer Enablement

I was trying to use regex in some Fill In Blank questions. I entered a regex as:

5\s*v?

in order to accept 5 or 5v or 5 v as answers. However, it turns out that it accepts: 3578! it actually accepts anything that has 5 in it. All of the following do the same

\s*

\s?

\s20?

\s*

Which is very strange.

I want to implement "Any number of spaces including 0 spaces". Do you have any idea?

 

Tagged:

Answers