public override string ToRegexPattern()
{
string result;
if (GroupIndex.HasValue)
{
result = "\\" + GroupIndex;
}
else
{
result = string.Format(CultureInfo.InvariantCulture, "\\k<{0}>", GroupName);
}
if (HasQuantifier)
{
result += Quantifier.ToRegexPattern();
}
return result;
}