%regexpPattern Creates a pattern that matches a regular expression
%   PAT = regexpPattern(EXPRESSION) returns a pattern that matches the
%   regular expression EXPRESSION.
%
%   PAT = regexpPattern(___,'DotExceptNewline',DOT) matches dot with any
%   character except newline when DOT is true. The default value of DOT is 
%   false.
%
%   PAT = regexpPattern(___,'FreeSpacing',SPACING) ignores space characters
%   and comments when matching if SPACING is true. The default value of 
%   SPACING is false.
%
%   PAT = regexpPattern(___,'IgnoreCase',IGNORE) ignores case when matching
%   characters if IGNORE is true. The default value of IGNORE is false.
%
%   PAT = regexpPattern(___,'Anchors',ANCHORS) treats ^ and $ metacharacters 
%   as line anchors when ANCHORS is 'line' and text anchors when ANCHORS is
%   'text'. The default value of ANCHORS is 'text'.
%
%   Examples
%       STR = "123 abc 456";
%
%       PAT = regexpPattern('\d+');
%
%       extract(STR,PAT)      % returns ["123";"456"]
%       contains(STR,PAT)     % returns true
%
%   See also pattern, regexp, regexprep, contains, extract, replace.

%   Copyright 2019-2020 The MathWorks, Inc.