public String parseToRegex(){
  if (regex == null) {
    regex=new StringBuilder("^");
    parseGlob();
    regex.append('$');
  }
  return regex.toString();
}

public String parseToRegex ( ) { if ( regex == null ) { regex = new StringBuilder ( "^" ) ; parseGlob ( ) ; regex . append ( '$' ) ; } return regex . toString ( ) ; }
parses this glob to create an equivalent regular expression that matches the same inputs .
