Skip to main content
Question

A360 If Condition Regex Match Does Not Work as I expected

  • 3 July 2023
  • 4 replies
  • 1066 views

Hey ALL!

I am building a bot on A360, and I need to insert a if conditon to see if a string starts with the number “8”. In the If module of A360, I selected Regex Tool → Regex Match is Found. And my regular expression is ^8 in the field of “Regex ”, which should be able to match any string that starts with 8. However, it does not work as I expected. For example, I tested 800000 using the logic shown below. However, I got the message 800000 does not start with 8. I am so confused. I appreciate it if anyone can help me out.

 

Hi, 

I couldn’t see any options with Regex Match. Could you share the screenshot.

 

Thanks


Hi,

I created a test bot that has the following logic. First I created a list with the above shown numbers. And I loop through the list, for each element in the list, I have the condition as below

This does not work as all the strings in the list are classified as “not starting with 8”.


Hi,

We don’t have the option to match a string pattern like you have used in the code. 

There is an alternate way, you can give it a try. Use the String → Find action and add your regex pattern, select “A regular expression”  and the output will always be 1 if it matches otherwise it will be 0.

Thanks


It works! Thanks for solving my question.


Reply