Attribute parameters must be constants, that is, those whose value can be resolved at compile time. But you can write your own simple attribute class that takes the element name in appSettings, gets the base value and passes it to the regular regexp processing. Then your attribute will look like this:
[ConfigedRegularExpression("PasswordExpression")]
where PasswordExpression is the name of the application parameter that contains the actual regular expression string.
and by writing this and doing a search (I should have done this first), I see that someone worked for you here:
How to write your own RegularExpressionValidator that takes values ββfrom a configuration file?
source share