regexp command expr(?!test) assertion fail

1 visualización (últimos 30 días)
Satyam Agrawal
Satyam Agrawal el 19 de Sept. de 2020
Comentada: Satyam Agrawal el 19 de Sept. de 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?

Respuestas (1)

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

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by