2 // This software is now distributed according to
3 // the Lesser Gnu Public License. Please see
4 // http://www.gnu.org/copyleft/lesser.txt for
8 package com.stevesoft.pat;
10 import java.util.Hashtable;
13 * Implements the (?<number) Pattern, where number is an integer telling us
14 * how far to back up in the Pattern. Not in perl 5. It also allows
17 class Backup extends Pattern
26 public String toString()
28 return "(?" + (bk < 0 ? ">" + (-bk) : "<" + bk) + ")" + nextString();
31 public int matchInternal(int pos, Pthings pt)
37 return nextMatch(pos - bk, pt);
40 public patInt minChars()
42 return new patInt(-bk);
45 public patInt maxChars()
47 return new patInt(-bk);
50 public Pattern clone1(Hashtable h)
52 return new Backup(bk);