Account for regular expressions with more than 9 groups.