regexTree = RegExpTree.parseRegExp(pattern, flags);
} catch (IllegalArgumentException ex) {
// Warnings are propagated in the CheckRegExp pass.
return subtree;
}
regexTree = regexTree.simplify(flags);
// Decompose the AST.
String literal = regexTree.toString();
String newPattern = literal.substring(1, literal.length() - 1);
// Remove unnecessary flags and order them consistently for gzip.
String newFlags = (