I was missing the obvious (thanks Robin for pointing me towards implementation)
Here is what happened :)
I checked if .net
supports conditionals (it does)
I put a conditional into Regex
attribute and it was happily parsed and compiled.
I then tried to check if it works by firing web form and entering gibberish. It should produce warning message about incorrect format when the input lost focus. It did not.
What I forgot is that this 'instant' client side validation (mvc unobtrusive validation) is actually done via jquery/javascript code generated and embedded by mvc templating engine.
This means it was actually javascript matching those patterns. Unfortunately javascript does not support conditionals so as soon as it saw one it went meh