String contains letter

0
Hi Community,   I am trying to check if a string contains a letter. This function should check if a string contains a capital letter or a lowercase letter. I tryied the following expression but is doesn't work. contains($String, '[A-Za-z]'). Can somebody help me with the expression that checks if a string contains a letter?   Thanks in advance.   Jasper Voerman
asked
2 answers
0

You need to use the isMatch function if you want to use a regular expression.

 

https://docs.mendix.com/refguide/string-function-calls/#ismatch

 

isMatch is anchored, so you need to take this into account. I've not tested it, but try something like this... 

 

isMatch($String, '.*[A-Za-z].*')

 

Good luck!

answered
0

Hi Jasper,

 

If I'm not wrong, you are checking with regular expression which can perform with isMatch() function only.

 

contains() can be used with particular format or letters like 'bggg'.

 

so, try same with isMatch() function.

 

Hope it helps.

answered