MATLAB Answers

0

regexprep with multiple expression

Asked by Pete sherer on 24 Aug 2012
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.

  0 Comments

Sign in to comment.

Tags

2 Answers

Answer by 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','')

  0 Comments

Sign in to comment.


Answer by Pete sherer on 24 Aug 2012

Yes. Thanks

  1 Comment

this is not an answer. if you are satisfied, you have to click on "accept answer"

Sign in to comment.