title: How to replace part of a string in Java, where it matches 1st few characters, escape some in between and matches some character at the end?
body: <p>I'm working on a Java which does some changes to an SQL file and covert it to an Oracle competible format.</p>
  
  <p>It seems for changing the Timestamp\date values, I need to use an oracle function "To_TIMESTAMP" to change it to some oracle understandable formart.</p>
  
  <p>Now to the real question. Below I have a String line;</p>
  
  <blockquote>
    <p><code>(1,'Ctx_Log-Log','','08.03.2017','2017-03-08 10:59:31','10:59:32','2017-03-08 10:59:41')</code></p>
  </blockquote>
  
  <p>where I'm interested in only values like <code>'2017-03-08 10:59:31'</code> and <code>'2017-03-08 10:59:41'</code> and these value can occur more than 2 times. I want to change\replace them to 
  <code>To_TIMESTAMP('2017-03-08 10:59:31','YYYY-MM-DD HH24:MI:SS')</code> and <code>To_TIMESTAMP('2017-03-08 10:59:41','YYYY-MM-DD HH24:MI:SS')</code></p>
  
  <p>and I don't want to disturb the other values. I tried to regex solution, but I could only match and replace the start of the string, like </p>
  
  <pre><code>string.replaceAll(",'201", ",To_TIMESTAMP('201")
  </code></pre>
  
  <p>which replace it to <code>To_TIMESTAMP('2017-03-08 10:59:31'</code>
  but I don't know how to replace the end part of <code>'2017-03-08 10:59:31'</code> to <code>'2017-03-08 10:59:31','YYYY-MM-DD HH24:MI:SS')</code>
  Any help will be appreciate. It doesn't matter which way or method is performed, as far as gives me the right solution. Thanks</p>