/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.logging.log4j.core.util;

import org.apache.oro.text.perl.Perl5Util;

public class AbsoluteDateAndTimeFilter implements Filter {
  private final Perl5Util util = new Perl5Util();

  public String filter(String in) {
    String pat = "/" + Filter.ABSOLUTE_DATE_AND_TIME_PAT + "/";

    if (util.match(pat, in)) {
      return util.substitute(
        "s/" + Filter.ABSOLUTE_DATE_AND_TIME_PAT + "//", in);
    } else {
      return in;
    }
  } 
}

@@ -945,16 +945,23 @@
 ilter %7B%0A
+    %0A  
   privat
@@ -1003,16 +1003,18 @@
 til();%0A%0A
+  
   public
@@ -1037,24 +1037,28 @@
 tring in) %7B%0A
+    
     String p
@@ -1110,16 +1110,20 @@
 + %22/%22;%0A%0A
+    
     if (
@@ -1141,24 +1141,30 @@
 pat, in)) %7B%0A
+      
       return
@@ -1180,25 +1180,16 @@
 stitute(
-%0A        
 %22s/%22 + F
@@ -1234,16 +1234,20 @@
 %22, in);%0A
+    
     %7D el
@@ -1253,24 +1253,30 @@
 lse %7B%0A      
+     
+ 
 return in;%0A 
@@ -1278,16 +1278,20 @@
 in;%0A
+    
     %7D%0A  
 %7D %0A%7D
@@ -1286,13 +1286,14 @@
     %7D%0A  
-%7D
  
+ %7D
 %0A%7D%0A

Format source.