- int step = -1;\r
- public int matchInternal(int pos,Pthings pt) {\r
- int m=-1;\r
- int i=pos;\r
- int endstr = pt.src.length()-step;\r
- patInt matches = new patInt(0);\r
- if(matchFewest) {\r
- if(fewestMatches.lessEq(matches)) {\r
- int ii = nextMatch(i,pt);\r
- if(ii >= 0) return ii;\r
- }\r
- while(i >= 0 && i <= endstr) {\r
- i=sub.matchInternal(i,pt);\r
- if(i >= 0) {\r
- matches.inc();\r
- if(fewestMatches.lessEq(matches)) {\r
- int ii = nextMatch(i,pt);\r
- if(ii >= 0) return ii;\r
- }\r
- if(matches.equals(mostMatches))\r
- return -1;\r
- }\r
+ fewestMatches = a;\r
+ mostMatches = b;\r
+ sub = p;\r
+ step = p.countMinChars().intValue();\r
+ sub.setParent(null);\r
+ }\r
+\r
+ public String toString()\r
+ {\r
+ return sub.toString() + "{"\r
+ + fewestMatches + "," + mostMatches + "}" +\r
+ (matchFewest ? "?" : "") + "(?# <= fast multi)" +\r
+ nextString();\r
+ }\r
+\r
+ int step = -1;\r
+ public int matchInternal(int pos, Pthings pt)\r
+ {\r
+ int m = -1;\r
+ int i = pos;\r
+ int endstr = pt.src.length() - step;\r
+ patInt matches = new patInt(0);\r
+ if (matchFewest)\r
+ {\r
+ if (fewestMatches.lessEq(matches))\r
+ {\r
+ int ii = nextMatch(i, pt);\r
+ if (ii >= 0)\r
+ {\r
+ return ii;\r
+ }\r
+ }\r
+ while (i >= 0 && i <= endstr)\r
+ {\r
+ i = sub.matchInternal(i, pt);\r
+ if (i >= 0)\r
+ {\r
+ matches.inc();\r
+ if (fewestMatches.lessEq(matches))\r
+ {\r
+ int ii = nextMatch(i, pt);\r
+ if (ii >= 0)\r
+ {\r
+ return ii;\r