regexp command expr(?!test) assertion fail

10 vues (au cours des 30 derniers jours)
Satyam Agrawal
Satyam Agrawal le 19 Sep 2020
Commenté : Satyam Agrawal le 19 Sep 2020
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?

Réponses (1)

Walter Roberson
Walter Roberson le 19 Sep 2020
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 commentaires
madhan ravi
madhan ravi le 19 Sep 2020
regexprep(str, '.*(ment)','')
Satyam Agrawal
Satyam Agrawal le 19 Sep 2020
Thanks ! It works.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by