View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 2.19 KB File ID: #43396 Version: 1.1




06 Sep 2013 (Updated )

Performs regular expression replacement in a file or files

| Watch this File

File Information

regexprepfile(filename,exp,repstr) performs a regular expression replacement using the pattern exp in the file filename with the string repstr. exp, repstr may also be cell arrays of strings of the same size, in which case the replacement is performed for each pair by performing a regexprep using corresponding elements of the inputs. Alternatively repstr may be a string and exp a cell array, in this case the single string repstr will replace all the patterns in exp.


regexprepfile replaces the string by creating a temporary copy of the file in which the replace is to be performed, replacing it in this file, and copying the file back to the original location for safety.


Note regexprepfile requires 'samesize.m' my file exchange contribution here:


Samesize inspired this file.

This file inspired Refactor Fcn Name.

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Other requirements requires 'samesize.m' my file exchange contribution here:
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
11 Sep 2013 1.1

asthetic change to file description, no change to file

Contact us