MATLAB: Matlab Editor: How to limit a “replace” to just the selected text

enhancement requestmatlab editorsearch and replace

Matlab Editor: How to limit a "replace" to just the selected text?
I don't see a check-box for this.
It would be very useful when searching and replacing.
Is this even possible in the Matlab editor (cf the Visual Studio editor).

Best Answer

I have submitted the replaceInSelection function to the File Exchange which solves this problem using the MATLAB Editor API. Having selected text in the editor window you can call replaceInSelection(oldSubStr, newSubStr) to perform a limited replace. I hope this helps.