1

I want to build a Regex to check only one occurrence of a keyword ".com" in a collection variable "collectprimaryURL"

It should be occurred only one time in the variable.

I'm using a Regex : REGEX({!collectprimaryURL},"(.com){1}")

but it is throwing syntax error to me.

Kindly help me out on this.

1 Answer 1

1

The regex function only tells you if a regex pattern was found in the supplied string. It won't count the number of occurrences, and it won't work on a collection variable.

You could use a loop on the collection variable to check each variable individually. You can then use a decision element to check if the individual variable contains the .com. This means you won't need the formula and regex pattern. If the .com is found, you can then use an assignment element to increment a counter by 1. After the loop is done you can then use another decision element to decide what you want to do if the counter is highter than 1.

2
  • It's fixed. Thank you May 2, 2020 at 13:24
  • That's good to hear @PravindraSingh. If this answer helped you, could you accept it? That way other people can easily see this question has been resolved.
    – Kasper
    May 2, 2020 at 14:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .