%% Update Text
% Replace words that begin with M, end with y, and have at least one character between them.

str = 'My flowers may bloom in May';
expression = 'M(\w+)y';
replace = 'April';

newStr = regexprep(str,expression,replace)

% Copyright 2012 The MathWorks, Inc.