CONTAINSTR returns TRUE if PATTERN is found in any element of string array S.
Sometimes, I need to search strings that match multiple patterns.
The use of strfind (regexp) combing with for-loop (cellfun) makes the script look long and messy.
In newer version (R2016b), it is easy to do in a single line of code.
Just call the built-in function 'contains', that easily determine if pattern is in string.
So, I created this function for users with older version to search pattern in text.
This function follows the same behaviour as 'contains'.
No more for-loop is needed.
wen-feng Huang (2020). containstr (https://www.mathworks.com/matlabcentral/fileexchange/70334-containstr), MATLAB Central File Exchange. Retrieved .
rewrite a concise version, and add 'regexp' engine