Regular expression question - NOT begin with certain char & not contain hyphen

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.

How can I do that?

Thanks.

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.

HTH!

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)

/^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.