Enable groups to specify the attribute the regular expression is matched against.
Iterator tidy ups.