function dr=rexpdir(reg,fspec)
%  rexpdir directory_name lists the files in a directory using regex
%  pattern matching.

% revision history:
% 06/06/11 Mark D. Shattuck <mds> rexpdir.m  

if(~exist('fspec','var') || isempty(fspec))
  fspec='*';
end
dr=dir(fspec);
dr=dr(~cellfun(@isempty,regexp({dr.name},reg)));
end


