* and ? operators

Hey guys,
I don’t understand the difference between the * and ? operators.
It’s written that * “matches characters that occur zero or more times”, And ? “as saying the previous element is optional”.
So what’s the difference?
Thanks in advance :slight_smile:

1st Challenge: Check for All or None

Link to the challenge:

2nd challenge: Match Characters that Occur Zero or More Times Passed
Link to the challenge:

? will match “0 or 1”, and * “0 or more”

so if you have colou?r it matches both “color” and “colour” but not “colouur”, if you have colou*r it matches also “colouuuuur”

1 Like

Great explanation, I get it now. Thanks :slight_smile: :heart: