"Matching" error

My "match" is working correctly for y_count = 1-9 but when y_count gets to 10 it doesn't match correctly (it incorrectly matches to the 1|5|9|13|17|21|25|29|33|37 set). Can you tell me how to fix this error? Thanks.

do any values greater than 9 match correctly? or more specifically, do any two digit values match correctly?

i suspect a good way to fix this might be to use a modulo operation as per How to do modulus calculation in maestro 7 prior to the switch statement to make your entire switch statement a lot simpler.

1 Like

It's matching the set that contains 1 because 10 also contains 1. While there may be a better way to solve this, one quick and easy way is to surround single digit matches with the regex for word boundary, \b, which tells the regex engine to only match single digits and not ones contained in numbers with multiple digits: