regexprep with multiple expression

18 views (last 30 days)
Pete sherer
Pete sherer on 24 Aug 2012
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.

Answers (2)

Daniel Shub
Daniel Shub on 24 Aug 2012
Is this what you want?
ttxt = 'hello parish world borough foo census area bar';
regexprep(ttxt, ' parish| borough| census area','')

Pete sherer
Pete sherer on 24 Aug 2012
Yes. Thanks
  1 Comment
Azzi Abdelmalek
Azzi Abdelmalek on 24 Aug 2012
this is not an answer. if you are satisfied, you have to click on "accept answer"

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!