regexprep with multiple expression

Hi,
Is there a way to consolidate these regexprep into one expression? regexprep(ttxt, ' parish',''); regexprep(ttxt, ' borough',''); regexprep(ttxt, ' census area','');
ttxt is a cell array.
Thanks.

답변 (2개)

Daniel Shub
Daniel Shub 2012년 8월 24일

2 개 추천

Is this what you want?
ttxt = 'hello parish world borough foo census area bar';
regexprep(ttxt, ' parish| borough| census area','')
Pete sherer
Pete sherer 2012년 8월 24일

0 개 추천

Yes. Thanks

댓글 수: 1

Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 24일
this is not an answer. if you are satisfied, you have to click on "accept answer"

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

카테고리

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

태그

질문:

2012년 8월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by