%asManyOfPattern Creates a pattern that matches consecutive repetitions of
%a specified pattern as many times as possible
%   NEWPAT = asManyOfPattern(PAT) returns a pattern that will match PAT as 
%   many times as possible including zero times.
%
%   NEWPAT = asManyOfPattern(PAT,minPattern) returns a pattern that matches
%   PAT as many times as possible but at least minPattern times.
%
%   NEWPAT = asManyOfPattern(PAT,minPattern,maxPattern) returns a pattern
%   that matches PAT as many times as possible but at least minPattern
%   times and no more than maxPattern times.
%
%   Examples
%       STR = ["foo abab bar"];
%
%       NEWPAT = asManyOfPattern("a"|"b",1);
%       extract(STR,NEWPAT)                   % returns  ["abab"; "ba"]
%
%       NEWPAT = asManyOfPattern("a"|"b",2,2);
%       extract(STR,NEWPAT)                   % returns  ["ab"; "ab"; "ba"]
%
%   See also pattern, asFewOfPattern, optionalPattern, contains, extract.

%   Copyright 2019-2021 The MathWorks, Inc.
