function out=subRegexFile(file,patt,sub)
% subRegexFile <Regex sub patt with sub in file. >
% Usage:: out=subRegexFile(file,patt,sub)
%

% revision history:
% 05/11/20 Mark D. Shattuck <mds> subRegexFile.m

%% Main

str=fileread(file);
fid=fopen(file,'w');
out=fwrite(fid,regexprep(str,patt,sub),'*char');
fclose(fid);
