regexp command expr(?!test) assertion fail
Show older comments
While using regexp command in following example :

I am expecting result to be 'Retiring' 'lovable' 'runtastic' but instead I am getting the following result:

Can someone please explain why is it so?
Answers (1)
Walter Roberson
on 19 Sep 2020
0 votes
Commencement matches \w* because it all word forming characters. It is followed by something that is not 'ment ' because the space after Commencement is not 'm'.
3 Comments
Satyam Agrawal
on 19 Sep 2020
madhan ravi
on 19 Sep 2020
regexprep(str, '.*(ment)','')
Satyam Agrawal
on 19 Sep 2020
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!