regexp command expr(?!test) assertion fail

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?

답변 (1개)

Walter Roberson
Walter Roberson 2020년 9월 19일

0 개 추천

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

How can I correct it? Any ideas ?
regexprep(str, '.*(ment)','')
Thanks ! It works.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2020년 9월 19일

댓글:

2020년 9월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by