Regex with a single quote in

I want to use the isMatch function with the following regex: ^[\p{L} ,.'-]{2,}+$   I create a string variable with this code to create the string for regex with the escape character for ' as \\' '^[\p{L} ,.\\' + '''' + '-]{2,}+$' That create a string that looked like this: ^[\p{L} ,.\\'-]{2,}+$ and according to this is valid and works, but mendix indicate it is invalid regex.   I am working on mendix studio pro version 10.6.1
1 answers

In Mendix you need to use two single quotes if your string contains a single quote.  Try the following...


^[\p{L} ,.''-]{2,}+$


There are some more details in the Mendix documentation.