conditionals with Regex