import org.apache.oro.text.regex.Perl5Matcher;
import org.apache.oro.text.regex.Perl5Substitution;
import org.apache.oro.text.regex.Util;
+import org.apache.oro.text.regex.Perl5Compiler;
import java.text.NumberFormat;
import java.util.Calendar;
return calendar.getTime();
}
- public String regexpReplace(String anInput, Pattern anExpression, String aReplacement) {
+ public String regexpReplace(String anInput, String anExpression, String aReplacement) throws Exception {
Perl5Matcher matcher = new Perl5Matcher();
return Util.substitute(
- matcher, anExpression,
+ matcher, new Perl5Compiler().compile(anExpression),
new Perl5Substitution(aReplacement), anInput,
Util.SUBSTITUTE_ALL);
}