MATLAB: How to recognize a word in a string

MATLABregexp

I would like to find a word in a string.

Best Answer

Regular expressions can be used to carry out matching of strings. For example if you would like to recognize the word canfeld you can use:
regexp('canfeld hallo refcanfeld canfeld canfelder canfeld','\<canfeld\>')
There are also other functions that can be used depending on the application. Functions such as STRMATCH, STRCMP, STRFIND can be used.