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 /** Provides the ability to match a backreference from within
\r
24 public String toString()
\r
26 return "\\" + (id) + nextString();
\r
29 public int matchInternal(int pos, Pthings p)
\r
31 int i1 = p.marks[id];
\r
32 int i2 = p.marks[id + p.nMarks];
\r
34 if (i1 < 0 || imax < 0 || pos + imax > p.src.length())
\r
38 int ns = p.src.length() - pos;
\r
43 for (int i = 0; i < ns; i++)
\r
45 if (p.src.charAt(i + i1) != p.src.charAt(pos + i))
\r
50 return nextMatch(pos + imax, p);
\r
53 Pattern clone1(Hashtable h)
\r
55 return new BackMatch(id);
\r