The documentation for Dynamic Server Pages (10-5_Dsp_And_Output_Template_Developers_Guide.pdf) claims that the %ifvar% tag supports regular expression matching:
“matches(‘regular_exp’) Specifies that the condition is true if the value of Variable
matches the regular expression regular_exp . For example:
%ifvar carrier matches(‘UPS*’)%.”
I’ve been trying to match odd numbers using character classes to workaround Outlooks lack of CSS support:
%ifvar $index matches('^[0-9]*[13579]$')%
and I’m beginning to suspect that the documentation is completely wrong and DSP does not support regular expressions at all, instead only simple globs.
May need to surround the string with / / to indicate it is a regex. The DSP doc does not say to do so, but the Service Development help indicates to do so for the multiple places where regex is supported – in a label for a step under a BRANCH and for an index, property or mask in WQL. It doesn’t reference DSPs specifically but I wouldn’t be surprised if enclosing in / is also needed there.
Thanks for the update on that. And for the other thread. That thread seems pretty concrete that regex is not supported. @Xiaowei_Wang indicated he did a patch, but looks like it never officially went into the product. Similar to what you noted, Xiaowei indicated “It just uses * and ? as kind of wild card.”
Maybe we submit a Brainstorm request? Or submit as bug? It seems it is either a product bug or a documentation bug (incorrectly indicating matches supports regex).
probably submitting both (Incident and Brainstorm request) and correlate them to each other.
Lets see which one will have an usable solution sooner or later.