class Expressions {

  public static Expression create(String expressionSpec) {

    /* parse the specification */
    Matcher matcher = EXPRESSION_PATTERN.matcher(expressionSpec);
    if (matcher.matches()) {
      /* look to see if there are any modifiers in the first group */
      String operator = matcher.group(1);

      /* extract the full variable specification */
      String spec = matcher.group(2);

      /* split the remainder of the expression */
      if (StringUtils.isNotEmpty(spec)) {
        /* create a new expression */
        return create(operator, Arrays.asList(spec.split(MULTIPLE_VALUE_DELIMITER)));
      } else {
        throw new IllegalArgumentException("Supplied expression: " + expressionSpec
            + " is not valid.  Please see RFC 6570 for more information how to construct an "
            + "expression");
      }
    } else {
      throw new IllegalArgumentException("Supplied expression: " + expressionSpec
          + " is not valid.  Please see RFC 6570 for more information how to construct an "
          + "expression");
    }
  }

}