substitution
"Andres Dominguez Burgos" <[email protected]> Thu, 3 Jul 2003 15:46:00 +0200
| Newsgroups | gmane.comp.jakarta.oro.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello.
How do you substitute if you have /b[a]b/ and you want [bbb]?
This does not seem to work:
String patt = " [.,]";
Perl5Matcher patternMatcher;
Perl5Compiler compiler = new Perl5Compiler();
patternMatcher = new Perl5Matcher();
try {
Perl5Pattern pattern = (Perl5Pattern) compiler.compile(patt);
Perl5Substitution subs = new Perl5Substitution("[.,]");
return Util.substitute(patternMatcher,pattern,subs,inputS,Util.SUBSTITUTE_ALL);
} catch(Exception e){
e.printStackTrace();
}
Thanks,
A