regexprepfile

版本 1.1.0.0 (2.2 KB) 作者: Richard Crozier
Performs regular expression replacement in a file or files
270.0 次下载
更新时间 2013/9/11

查看许可证

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: http://www.mathworks.com/matlabcentral/fileexchange/36636-samesize

引用格式

Richard Crozier (2024). regexprepfile (https://www.mathworks.com/matlabcentral/fileexchange/43396-regexprepfile), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Characters and Strings 的更多信息
致谢

参考作品: samesize

启发作品: refactor_fcn_name

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

asthetic change to file description, no change to file

1.0.0.0