Check if self.flags is set instead of the param flags when testing for the regex type.