For example, this is how we check email address in the validator https://github.com/symfony/symfony/blob/27e1a893a090bf58bce774660f6cb5cbdfd4d287/src/Symfony/Component/Validator/Constraints/EmailValidator.php#L66