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
9 import java.util.Hashtable;
\r
11 /** This is the '.' character in a Pattern. It
\r
12 matches any character. */
\r
13 class Any extends Pattern {
\r
14 public int matchInternal(int pos,Pthings pt) {
\r
15 if(pos < pt.src.length())
\r
16 if(pt.dotDoesntMatchCR) {
\r
17 if(pt.src.charAt(pos) != '\n')
\r
18 return nextMatch(pos+1,pt);
\r
19 } else return nextMatch(pos+1,pt);
\r
22 public String toString() {
\r
23 return "."+nextString();
\r
25 public patInt minChars() { return new patInt(1); }
\r
26 public patInt maxChars() { return new patInt(1); }
\r
27 public Pattern clone1(Hashtable h) { return new Any(); }
\r