This is a variant of Regex.simpleMatch that takes an array as the first parameter. This will simplify this code.