Azure Policy - Support for RegEx in Match Conditions
Right now, the "Match" and "notMatch" conditions only support # for digit placeholders and ? for letters. This is okay, but it would be much more useful to support regex expressions. This would needed for define complex naming policies and tagging standards.
Marcio Parente commented
I'm trying to apply the following regex expression and no success.
One would expect regex when it is named match.
Current options cannot be used to match our naming standard. At least more complex conditions needed, for example multiple asterisks.
But why invent something new, when there is a good and relative standard way of doing this (already supported by .net).
Steve Keeler commented
Please consider implement basic regular expression pattern matching. If ReDoS is a concern, then limit so extensions such as back-tracking not implemented. I have multiple customers requesting this functionality.
Nick C commented
I second this idea. Either allow more complex conditions, or allow regular expressions. Even allowing two wildcards within a 'like' condition would be enormously helpful. Right now, enforcing naming policy is cumbersome.