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;
13 * This class implements the (?@<>) syntax that matches a balanced parenthesis.
16 class Group extends Pattern
20 Group(char opi, char cli)
26 public int matchInternal(int pos, Pthings pt)
29 if (pos < pt.src.length())
31 if (!Masked(pos, pt) && pt.src.charAt(pos) != op)
36 for (i = pos + 1; i < pt.src.length(); i++)
38 char c = pt.src.charAt(i);
39 boolean b = !Masked(i, pt);
52 return nextMatch(i + 1, pt);
63 public String toString()
65 return "(?@" + op + cl + ")" + nextString();
68 public patInt minChars()
73 Pattern clone1(Hashtable h)
75 return new Group(op, cl);