How do I match all the words in a string except the one I specify using REGEXP in MATLAB 7.0 (R14)?
15 次查看(过去 30 天)
显示 更早的评论
I have a string and I want to get all the words in the string except for the one that I specify.
采纳的回答
MathWorks Support Team
2009-6-27
You can match all words except the one you specify by executing the following commands:
testStr = 'The seed of the tree has linseed and is seedless';
matchs = regexp(testStr, '\<(?!seed\>)\w*', 'match')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!