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;
12 /** The '^' or the '\A' Pattern, matches the start of a string. */
13 class Start extends Pattern
22 public int matchInternal(int pos, Pthings pt)
24 if (retIsStart && pt.mFlag && pos > 0 && pt.src.charAt(pos - 1) == '\n')
26 return nextMatch(pos, pt);
30 return nextMatch(pos, pt);
35 public String toString()
39 return "^" + nextString();
43 return "\\A" + nextString();
47 public patInt maxChars()
52 Pattern clone1(Hashtable h)
54 return new Start(retIsStart);