REGEX doesnt seem to give the correct result

Hey all,   I’ve got an issue with a simple REGEX that I’m using in a nanoflow. The function that I’m suing is: isMatch($Variable, '/11|12|13|RES/') When I create a variable before it and give it any value (either RES, or 11 or anything else) it will always return false.   I don’t really get how this works, on any regex tester I get a correct result back, so the regex works, it just doesn’t work in Mendix or am I doing something wrong?
3 answers

Hi Melvin,

Did you set the Regex tester to the correct language? Because each programming language has different Regex syntax unfortunately. If it's a microflow, it uses Java syntax. If it's a nanoflow, it uses JavaScript syntax. Make sure to search for a Regex validator for your programming language. I always use Regex101 where you can set the syntax on the left side of the screen.


What are you trying to check? Should the input contain, exactly match, start with those inputs?


Those slashes are a notation from javascript  (regular expression literal) for regexes and not needed in Mendix.


It should return true on either one of the following four strings:





And false on everything else. Maybe you don’t want the slashes in there?