Others got your answer. This is just an aside re: Regular Expressions.
When you say "conditions" in regular expressions, it refers to the regex language. Like any language, its a branch in code execution, but the code is a different regular expression path, the "code" of regular expressions.
So in psudo code: if (evaluation is true) do this regular sub-expression, else do this other sub-expression.
This conditional exists in advanced regular expression engines ... Perl.
Perl uses the most advanced regular expression engine that exists. In version 6 and beyond it will be an integral part of the language, where code and expression intermingle seamlessly.
Perl 5.10 has this construct:
(?(condition)yes-pattern|no-pattern).
Edit Just a warning that where Perl goes, every other language follows as far as regular expression.