How do I match all the words in a string except the one I specify using REGEXP in MATLAB 7.0 (R14)?

22 views (last 30 days)

Accepted Answer

MathWorks Support Team
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')

More Answers (0)

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!