foreach for for the ValidContentVariable and notRegex functions