Is it possible to do conditional regex (like the one described in http://www.regular-expressions.info/conditional.html) in Vim?
Not natively, however if you have +perl in vim you should be able to use
:perldo s/search/replace/