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 * Simple custom patterns. See <a
\r
14 * href="http://javaregex.com/code/deriv2.java.html">deriv2.java</a> and <a
\r
15 * href="http://javaregex.com/code/deriv3.java.html">deriv3.java</a> in the
\r
18 * @see com.stevesoft.pat.CustomEndpoint
\r
20 class Custom extends PatternSub
\r
31 v = (Validator) Regex.validators.get(s);
\r
34 public int matchInternal(int pos, Pthings pt)
\r
37 return sub.matchInternal(pos, pt);
\r
40 public String toString()
\r
42 String a = v.argsave == null ? "" : ":" + v.argsave;
\r
43 return "(??" + select + a + ")" + nextString();
\r
46 public patInt minChars()
\r
48 return v.minChars();
\r
51 public patInt maxChars()
\r
53 return v.maxChars();
\r
56 Pattern clone1(Hashtable h)
\r
58 Custom c = new Custom(select);
\r
61 c.sub = sub.clone(h);
\r