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 /** Simple custom patterns. See
\r
13 <a href="http://javaregex.com/code/deriv2.java.html">deriv2.java</a>
\r
14 and <a href="http://javaregex.com/code/deriv3.java.html">deriv3.java</a>
\r
15 in the test directory.
\r
16 @see com.stevesoft.pat.CustomEndpoint
\r
27 v = (Validator) Regex.validators.get(s);
\r
30 public int matchInternal(int pos, Pthings pt)
\r
33 return sub.matchInternal(pos, pt);
\r
36 public String toString()
\r
38 String a = v.argsave == null ? "" : ":" + v.argsave;
\r
39 return "(??" + select + a + ")" + nextString();
\r
42 public patInt minChars()
\r
44 return v.minChars();
\r
47 public patInt maxChars()
\r
49 return v.maxChars();
\r
52 Pattern clone1(Hashtable h)
\r
54 Custom c = new Custom(select);
\r
57 c.sub = sub.clone(h);
\r