All Implemented Interfaces:
Serializable, IClusterable
Direct Known Subclasses:
Group, OptionalMetaPattern

public class MetaPattern extends Object implements IClusterable
Useful class for constructing readable and reusable regular expressions.

MetaPatterns can be constructed from a simple regular expression String, from other MetaPatterns (copy constructor), from a list of MetaPatterns or from an array of MetaPatterns. In this way, it is easy to build up larger patterns while transparently binding the capturing groups of each MetaPattern for easy object oriented access to capturing group matches.

A given MetaPattern can be converted to a Matcher or Pattern. Groups within the MetaPattern can be used to automatically reference capturing group values when a match is made with a Matcher object.

A variety of static constants are provided for use in constructing compound MetaPatterns. Also, a number of simple parsers have been constructed using MetaPatterns in the parsers subpackage.

Jonathan Locke
See Also: