Ok, big merge. here's the new xml-config stuff in action. There's a few
[mir.git] / source / mir / misc / StringUtil.java
index 49004c1..e226c06 100755 (executable)
@@ -225,6 +225,24 @@ public final class StringUtil {
     return buf.toString();
   }
 
+  /**
+   * Ersetzt in String <code>s</code> das Regexp <code>pattern</code> durch <code>substitute</code>
+   * @param s
+   * @param pattern
+   * @param substitute
+   * @return String mit den Ersetzungen
+   */
+  public static String regexpReplace(String haystack, String pattern, String substitute) {
+    try {
+      RE regex = new RE(pattern);
+      return regex.substituteAll(haystack,substitute);
+    } catch(REException ex){
+      return null;
+    }
+  }
+
+
 
   /**
    * Fügt einen Separator an den Pfad an