I’ve been struggling with trying to put together a regex and so now I’m looking for assistance. For example if I loop over vars that contains the below:
17581-2
16789
G18088494
I want to do a BRANCH step and state in a sequence step that it should match on the one that does NOT start with the character “G” and does NOT contain a hyphen. Criteria is both must not be in the var. In the above example, it would match on only 16789.
You can make use of pub.string:indexOf service. If String contains ‘G’ at the start it will return its index as 0, based on the result you can branch. Same will hold good for searching ‘-’ in the string.
BRANCH on 'yourVar'
/^G/: SEQUENCE (Ignore entries beginning with G)
/-/: SEQUENCE (Ignore entries containing '-')
$default: SEQUENCE (Entry does not start with G nor contain '-' so proceed)