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:
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.
How can I do that?
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.
Validate loop using branch steps with regular expressions.
use “^” for starting with char and “.” for any alphanumerical chars for a string
cant able to work out with above, let me know…
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)
/^G|[-]/: SEQUENCE (Entry start with G or contain ‘-’) $default: SEQUENCE (Entry does not start with G nor contain ‘-’ so proceed)
THANKS Everybody for your suggestions! I’m good to go now.