class SymbolicAsPathRegex extends SymbolicRegex implements Comparable<SymbolicAsPathRegex> {

  @Override
  public Automaton toAutomaton() {
    /**
     * A regex need only match a portion of a given AS-path string. For example, the regex "_40_"
     * matches AS paths that contain the AS number 40 anywhere. But to properly relate AS paths to
     * one another, for example to find their intersection, we need regexes that match completely.
     *
     * <p>The simple approach below converts a possibly-partial regex into a complete one. It works
     * because below we intersect the resulting automaton with AS_PATH_FSM, which notably includes
     * the start-of-string and end-of-string characters. Note that the automaton library treats
     * these as ordinary characters.
     */
    String regex = ".*" + "(" + _regex + ")" + ".*";
    return new RegExp(regex).toAutomaton().intersection(AS_PATH_FSM);
  }

  public  SymbolicAsPathRegex(String regex);

}