String[] templatePrefixes;
String[] templateSuffixes;
try {
REVisitor<RuntimeException> transformer = descriptor.getCaptureGroup() ?
new CaptureGroupTransformation() : new NonCaptureGroupTransformation();
REParser parser = new REParser(regex);
//
RENode.Disjunction routingDisjunction = parser.parseDisjunction();
if (!preservePath) {
CharEscapeTransformation escaper = new CharEscapeTransformation('/', '_');
routingDisjunction.accept(escaper);
}
routingDisjunction.accept(transformer);
RERenderer.render(routingDisjunction, routingRegex);
//
parser.reset();
RENode.Disjunction renderingDisjunction = parser.parseDisjunction();
ValueResolverFactory factory = new ValueResolverFactory();
renderingDisjunction.accept(transformer);
List<ValueResolverFactory.Alternative> alt = factory.foo(renderingDisjunction);
renderingRegexes = new RERef[alt.size()];
templatePrefixes = new String[alt.size()];