Regex to Match word

0
Hello Everyone,    I am looking for regex expression to match a word in  sentence  using IsMatch function  Example :  InputString : This is to test word Regex  InputWord : word  I want to IsMatch function to return true .  
asked
3 answers
3

The contains function will also return true when the word is part of another word. So “swords” or “wordsmith” will also return true. If you want to check for complete words you could use the word boundary. Something like

ismatch(haystack, ‘.*\b(needle)\b.*’)

Replace needle with the word you’re looking for.

answered
2

Why not use the “contains” function? This will do exactly as you want to and check whether the word “word” is in your string.

 

The IsMatch function will check if they are a exact match.

answered
0

Hi,

Check the below link of IsMatch Mendix Documentation

isMatch('234hello6432', '^([0-9]+)$')

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

As Roy mentioned, you can also try contains function

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

Hope it helps!!!

answered