public String toString(int options) {
String ret = null;
switch (this.type) {
case PAREN:
if (this.parennumber == 0) {
ret = "(?:"+this.child.toString(options)+")";
} else {
ret = "("+this.child.toString(options)+")";
}
break;
case LOOKAHEAD:
ret = "(?="+this.child.toString(options)+")";
break;
case NEGATIVELOOKAHEAD:
ret = "(?!"+this.child.toString(options)+")";
break;
case LOOKBEHIND:
ret = "(?< ="+this.child.toString(options)+")";
break;
case NEGATIVELOOKBEHIND:
ret = "(?< !"+this.child.toString(options)+")";
break;
case INDEPENDENT:
ret = "(? >"+this.child.toString(options)+")";
break;
}
return ret;
}
|