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
13 * Implements the (?<number) Pattern, where number is an integer telling us
\r
14 * how far to back up in the Pattern. Not in perl 5. It also allows
\r
17 class Backup extends Pattern
\r
26 public String toString()
\r
28 return "(?" + (bk < 0 ? ">" + (-bk) : "<" + bk) + ")" + nextString();
\r
31 public int matchInternal(int pos, Pthings pt)
\r
37 return nextMatch(pos - bk, pt);
\r
40 public patInt minChars()
\r
42 return new patInt(-bk);
\r
45 public patInt maxChars()
\r
47 return new patInt(-bk);
\r
50 public Pattern clone1(Hashtable h)
\r
52 return new Backup(bk);
\r