Look this so simple if you remember these rule for constructing Regex.
Modifier
Description
i
Perform case-insensitive matching
g
Perform a global match (find all matches rather than stopping after the first match)
m
Perform multiline matching
Quantifier
Description
n+
Matches the preceding expression 1 or more times.
n*
Matches the preceding expression 0 or more times.
For example, /a+/ matches the 'a' in "candy" and all the a's in "caaaaaaandy", but nothing in "cndy".
For example, /bo*/ matches 'boooo' in "A ghost booooed" and 'b' in "A bird warbled" but nothing in "A goat grunted".