This class is inteded to be used to declare a named pattern by
extending the class to a case object. For example,
caseobject SomeName extends Group("[a-z]+")
SomeName defines a pattern matches with lower case alphabets
captured as a group. The name of the group defaults to the value
of SomeName.toString. Note that the default value of toString
for a case object is the name of the object, which is
"SomeName" in this example.
A class to represent a group of pattern.
This class is inteded to be used to declare a named pattern by extending the class to a
case object
. For example,SomeName
defines a pattern matches with lower case alphabets captured as a group. The name of the group defaults to the value ofSomeName.toString
. Note that the default value oftoString
for acase object
is the name of the object, which is"SomeName"
in this example.