whoops
authorzapata <zapata>
Thu, 10 Aug 2006 19:55:20 +0000 (19:55 +0000)
committerzapata <zapata>
Thu, 10 Aug 2006 19:55:20 +0000 (19:55 +0000)
source/mir/misc/StringUtil.java

index 6bdeac7..7f08337 100755 (executable)
@@ -30,6 +30,7 @@ import org.apache.oro.text.regex.Pattern;
 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;
@@ -220,11 +221,11 @@ public final class StringUtil {
     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);
   }