/g = makes $regex() return the number of matches, rather than just 1 for a match and 0 for a nonmatch.
/i = case-insensitive, so /A/i would match even if you applied it to "aaa"
/x = ignore spaces in the expression, so /a a/x is equivalent to /aa/ .. I basically used it here because it's easier than using $+