code: public static RegexPathTemplate create(String urlTemplate) {
          StringBuffer baseUrl = new StringBuffer();
          Map<String, PathTemplate> templates = new HashMap<String, PathTemplate>();
          CurlyBraceTokenizer t = new CurlyBraceTokenizer(urlTemplate);
          while (t.hasNext()) {
              String tok = t.next();
              if (CurlyBraceTokenizer.insideBraces(tok)) {
                  tok = CurlyBraceTokenizer.stripBraces(tok);
  
                  int index = tok.indexOf(':'); // first index of : as it can't appears in the name
                  String name;
                  Pattern validationPattern;
                  if(index > -1) {
                      name = tok.substring(0, index);
                      validationPattern = Pattern.compile("^" + tok.substring(index + 1) + "$");
                  }else{
                      name = tok;
                      validationPattern = DEFAULT_VALIDATION_PATTERN;
                  }
                  Validate.isTrue(TEMPLATE_NAME_PATTERN.matcher(name).matches(), "Template name '%s' doesn't match the expected format: %s", name, TEMPLATE_NAME_PATTERN);
                  Validate.isFalse(templates.containsKey(name), "Template name '%s' is already defined!", name);
                  templates.put(name, new PathTemplate(name, validationPattern));
                  baseUrl.append("{").append(name).append("}");
              } else {
                  baseUrl.append(tok);
              }
          }
          String url = baseUrl.toString();
          isTrue(!Urls.hasQueryString(url), "Given url contains a query string: %s", url);
          return new RegexPathTemplate(url, templates);
      }
docs: Creates a regex path template for the given URI template
  @param urlTemplate uri that can hold placeholders
  @return a new regex path template instance