When i try to quoate ( and ) it doesn't work any Idea ? Or is there a function for Quating Strings ?
public String quoateString( String text ) { Pattern ep = new Pattern( "[`.*+?\\{\\}[]()|^$\'-]" ) ; Substitution myOwnModel = new Substitution(){ public void appendSubstitution(MatchResult match,TextBuffer tb){ tb.append('\\'); match.getGroup(MatchResult.MATCH,tb); } } ; Replacer ereplacer = new Replacer(ep, myOwnModel) ; return ereplacer.replace( text ) ; }
Log in to post a comment.
When i try to quoate ( and ) it doesn't work any Idea ?
Or is there a function for Quating Strings ?
public String quoateString( String text )
{
Pattern ep = new Pattern( "[`.*+?\\{\\}[]()|^$\'-]" ) ;
Substitution myOwnModel = new Substitution(){
public void appendSubstitution(MatchResult match,TextBuffer tb){
tb.append('\\');
match.getGroup(MatchResult.MATCH,tb);
}
} ;
Replacer ereplacer = new Replacer(ep, myOwnModel) ;
return ereplacer.replace( text ) ;
}