Info
この質問は閉じられています。 編集または回答するには再度開いてください。
search large amount of words
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all, I have a string from URL in CHAR form, and i want to execute a search of large amount of words, does someone have an idea how to do that? thank you very much!
8 件のコメント
Walter Roberson
2017 年 9 月 25 日
matchpattern = ['(?<=\W)', strjoin(WordListCell, '(?=\W)|(?<=\W)'), '(?=\W)' ];
results = regexp(txt, matchpattern, 'match');
This would be for the case of exact matches of words -- so for example plurals would not be matched, and words with article prefix characters would not be matched. I do not promise that \W knows about the proper classification of Hebrew characters.
回答 (2 件)
Image Analyst
2017 年 9 月 25 日
What about simply using the contains() function?
Description
TF = contains(str,pattern) returns 1 (true) if str contains the specified pattern, and returns 0 (false) otherwise.
If pattern is an array containing multiple patterns, then contains returns 1 if it finds any element of pattern in str.
1 件のコメント
Walter Roberson
2017 年 9 月 25 日
Note: contains() does not check word boundaries. For example it would find "his" in "this".
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!