}
} else if (pattern instanceof RegexLiteral) {
RegexLiteral regexLiteral = (RegexLiteral) pattern;
try {
NamedPattern compiled = NamedPattern.compile(regexLiteral.value);
if (compiled.groupNames().contains(name))
return true;
} catch (RuntimeException e) {
addError("Malformed regular expression: " + regexLiteral.value
+ " (" + e.getMessage() + ")",