fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String p = "(?i)^\"(\\w+) (\\w+) (\\w+) (?:.+)?\",\"(\\d+)\\.(\\d+)\\.(\\d+)\",\"(\\d+):(\\d+):(\\d+)\"(?:.*?)$";
  13. String rep = "$6-$5-$4 ==> $7:$8 $1 $2 $3";
  14. String test = "\"AK Pz 310u PI-13-5\",\"23.02.2015\",\"07:45:00\",\"23.02.2015\",\"09:20:00\",\"False\",\"True\",\"23.02.2015\",\"07:40:00\",\"2\",\"Common\",\"AK Pz 310u PI-13-5\",\"Common\"";
  15. String s = test.replaceAll(p, rep);
  16. System.out.print(s);
  17. }
  18. }
Success #stdin #stdout 0.11s 320320KB
stdin
Standard input is empty
stdout
2015-02-23 ==> 07:40 AK Pz 310u