regexp command expr(?!test) assertion fail

조회 수: 18 (최근 30일)
Satyam Agrawal
Satyam Agrawal 2020년 9월 19일
댓글: Satyam Agrawal 2020년 9월 19일
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일
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
madhan ravi
madhan ravi 2020년 9월 19일
regexprep(str, '.*(ment)','')
Satyam Agrawal
Satyam Agrawal 2020년 9월 19일
Thanks ! It works.

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

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by