How do I match all the words in a string except the one I specify using REGEXP in MATLAB 7.0 (R14)?
19 views (last 30 days)
Show older comments
I have a string and I want to get all the words in the string except for the one that I specify.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
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 Comments
More Answers (0)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!