2 // This software is now distributed according to
\r
3 // the Lesser Gnu Public License. Please see
\r
4 // http://www.gnu.org/copyleft/lesser.txt for
\r
6 // -- Happy Computing!
\r
8 package com.stevesoft.pat;
\r
12 /** Matches any number of instances of sub Pattern
\r
13 this was the hardest method to write. It implements
\r
14 '+', '*', '?', "{0,10}", "{5,}", "{5}", etc.
\r
15 @see pat.Multi_stage2
\r
22 public patInt minChars()
\r
24 return a.mul(p.countMinChars());
\r
27 public patInt maxChars()
\r
29 return b.mul(p.countMaxChars());
\r
34 public boolean matchFewest = false;
\r
36 @param a The fewest number of times the sub pattern can match.
\r
37 @param b The maximum number of times the sub pattern can match.
\r
38 @param p The sub pattern.
\r
42 public Multi(patInt a, patInt b, Pattern p)
\r
48 st2 = new Multi_stage2(a, b, p);
\r
53 public String toString()
\r
55 st2.matchFewest = matchFewest;
\r
56 return st2.toString();
\r
59 public int matchInternal(int pos, Pthings pt)
\r
63 st2 = new Multi_stage2(a, b, p);
\r
65 catch (RegSyntax r__)
\r
67 st2.matchFewest = matchFewest;
\r
69 return st2.matchInternal(pos, pt);
\r
72 public Pattern clone1(Hashtable h)
\r
76 Multi m = new Multi(a, b, ( (Pattern) p).clone(h));
\r
77 m.matchFewest = matchFewest;
\r
80 catch (RegSyntax rs)
\r