regexprep with multiple expression

10 ビュー (過去 30 日間)
Pete sherer
Pete sherer 2012 年 8 月 24 日
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 日
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 日
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"

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by