Integration Server DSPs and regex

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.

Does anyone know for sure?

Hi,

I am not sure if your regexp expressions are correct.

Regards,
Holger

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.

Hi Holger,

Thanks but the regex is fine. You can test that it matches any odd number here.

Thanks Reamon,

I’m afraid that doesn’t work either. I see someone else complaining about it here.

I suspect that when this was developed they didn’t know the difference between a regular expression and a glob.

But even the glob doesn’t work properly. If I do something like this
%ifvar $index matches('*2')%

it matches
2
12
32
43
52

But not 22!

Bizarre. I think it’s just never worked properly.

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. :frowning: 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).

1 Like

Hi Rob,

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.

Regards,
Holger