Regular expressions in LabVIEW supports parentheses for partial matches, but this fails if your partial match is a set of operators.
Let's say I want to match "XYZ_Level" or "Level", where XYZ can be any number of characters including an empty string, the underscore must be there if XYZ is different from an empty string. These strings are valid candidates for instance:
"Level"
"_Level"
"a_Level"
"much:more_Level"
These aren't:
"aLevel"
"abc_defLevel"
I'd construct a regular expression as input to the Match Pattern primitive like this then: "(.*_)?Level", but this fails matching any of the good examples above. I think the parentheses fail to parse correctly when they contain operators? I have also tried specifying a partial match using the pipe character, like this: "(.*_|)Level", but this won't work either, probably because I need something on the right hand side of the pipe to tell the regex parser that the alternative is an empty string. An empty string is usually denoted by the epsilon character in regular expressions, but LabVIEW doesn't recognize that.
So, (unless I'm mistaken) I'd suggest LabVIEW to support parenthese in regular expressions as means of grouping anything including operators, not only substrings.
Cheers,
Steen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.