function res = reg_exp(str,pat)

% reg_exp - match regular expression and pack result
% --------------------------------------------------
%
% res = reg_exp(str,pat);
%
% Input:
% ------
%  str - string to match
%  pat - regular expression
%
% Output:
% -------
%  res - results structure

%--------------------------------
% Author: Harold Figueroa
%--------------------------------
% $Revision: 1380 $
% $Date: 2005-07-27 18:37:56 -0400 (Wed, 27 Jul 2005) $
%--------------------------------

%--
% add string and pattern to result
%--

res.str = str; 

res.pat = pat;

%--
% match regular expression and add outputs to result
%--

[res.start, res.end, res.extent, res.match, res.token, res.name] = regexp(str,pat);

%--
% display result if no output
%--

if (~nargout)
	disp(' '); disp(show_reg_exp(res)); disp(' ');
end
