MATLAB: Regexp qwestion

matrixregexp

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?

Best Answer

TheString = 'gftr dsrew mkjghfdfsde'
out = regexprep(TheString,'s','1')