regexp qwestion

2 views (last 30 days)
Raldi
Raldi on 2 Dec 2011
Hi everyone
i have an exprecion of the type numstrscheck = regexp(TheString, '-?\d+\.?\d*', 'match');
is there a way that alongside with any other operations that are done inside regexp, to also substitute the letter s of 'TheString' if it has any, with the number one?

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 2 Dec 2011
TheString = 'gftr dsrew mkjghfdfsde'
out = regexprep(TheString,'s','1')
  1 Comment
Raldi
Raldi on 2 Dec 2011
Thanks Andrei

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!