MATLAB: I’m looking to search a String for a given value and then, if this value is found (anywhere in the string), I want to replace the entire string with a new one. Is this possible with regexprep

MATLABregexprep

As previously stated, I'm looking to search a string for a given value. If this value is present in the string, anywhere at all, I want to replace this entire string with an new one. I've spent about an hour trying to accomplish this with regexprep, but regexprep only seems to allow me to replace the portion of the string I'm searching for with a new string.
For example, I have a variable with a string value of the alphabet here:
String = abcde+fghijklm+nopq+rstuvwxyz
I want to search this string and make sure there aren't any random '+' signs in there to throw off my groove. If there are, I want to replace the entire string with the actual alphabet, without the random plus signs in there. I can search this string for a '+' using regexprep like this
String= regexprep(String,'+','abcdefghijklmnopqrstuvwxyz')
but this method will replace only the plus sign with the alphabet, leaving me with an alphabet inside an alphabet. I want it to replace the entire incorret string with a the new, correct one. Is there any way to do this using regexprep? Or any other method?
My end goal is to search a string for a given value, and then, if found, replace the entire string with a new one. I appreciate any help.

Best Answer

regexprep(String, '.*\+.*', 'a':'z')
If there are no matches because there is no + then the replacement is not done, leaving everything intact.