Use a regular expression in a condition