Expert Refresh

Optional items

1) Which character is optional in colou?r

2) A regex containing optional metacharacter is always successful?

3) What is one of the main uses of parantheses?

Question mark
Question mark in /colou?r/ means "optional". It is placed after the character that is optional (might appear but isn't required).
Always successful
The u? part is always successful. This isn't to say that any regex that contains ? is always successful. For example, in /colou?r/ against "semicolon", both "colo" and "u?" are successful, but r fails, so the whole regex fails.
Grouping for ? (and other similar metacharacters) is one of the main uses of parantheses. For example /4th|4/ can be simplify to /4(th)?/