%else%
…
im trying to match the “dayGap” variable to 1-1000 numbers. But it is not working… May I know what is wrong here? does webMethods support reg ex for numbers?
^ - anchor to the beginning of the string
(?: - non-capturing version of parentheses
0 - match zero
| - or
[1-9] - digits 1 through 9
\d - any digit
(0,2) - 0, 1, 2 repeat of previous
$ - anchor to end of the string
Have you confirmed dayGap is present and has a value? (Equivalent of “is it plugged in” but I gotta ask )
I assume daysRemaining (previously dayGap?) is a child element within sortedCerts? Possible scoping issue.
Can you share the doc list structure screen shot? Perhaps the Results tab showing the pipeline of the service once it has obtained its list of sortedCerts. Still don’t see evidence that daysRemaining is populated but I guess I’ll trust that you see 35, 215, etc.
Might I suggest a possible simplification of the DSP. No need to repeat all the <TD> tags for all the fields. Use the ifvar to “write” the <TR> as desired (with or without highlight) followed by one set of the fields.
I’m not attempting to answer the original question, but just want to recommend online regex testing services like https://regex101.com/ – they are a great way to test, validate and understand regexs.
Regular expression which matches the numbers between 1-100…So I expect my row colour should change but it is not working as expected…
That is what im looking for help here…
^\d{1,2}$ matches one or two digits and covers 0-99. The ^100$ just checks for ‘100’.
I tested the regex above and saved the regex query here. The blue highlights shows how the regex matches numbers from 0 to 100, but does not match other numbers or values.
.
But try avoiding regexs when possible. For instance, you could calculate a cert_alert variable (true/false) in your Flow code and change the DSP background based on its value.
Personally, regexs intimidate me somewhat. There’s this famous saying:
Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.
Debatable, but I do understand the concern about regex. Easy to get them wrong. As with many computing topics, takes time to understand and get comfortable with them.
It is likely that “regular expression” in the DSP context is not regular expressions at all. Found this from years ago:DSP regular expressions (ifvar matches)
“It just uses * and ? as kind of wild card.”
This is from Xiaowei Wang back in 2015. In that thread he indicates he patched it to make it support regex – but that would apply to his own installation.
So mystery solved I think – ifvar matches support wildcards, not regex. Even the example in the help doc for ifvar implies this:
For example: %ifvar carrier matches(‘UPS*’)%.
If that were regex, it would match strings starting with UP followed by 0 or more S chars. Unlikely to be useful. A regex for this would be ‘UPS.*’
Documentation bug IMO. And would be nice if in addition to the math operators it would support regex (and maybe wildcards).