title: How to replace before and after characters of a particular string
body: <p>I am working on converting SQL server inserts into MySQL inserts using some Linux file level operations.
  Can some one please let me know how to convert all occurrences of below in a line </p>
  
  <pre><code>(..,CAST(0x0000722300000000 AS DateTime),..,CAST(0x0000979900C10112 AS DateTime),...)
  </code></pre>
  
  <p>as shown below</p>
  
  <pre><code>(..,myfunc(0x0000722300000000),..,myfunc(0x0000979900C10112),...)
  </code></pre>
  
  <p>EXAMPLE:</p>
  
  <p>Need to convert CAST(hexval AS DateTime) as myfunc(hexval) where hexval is dynamic.</p>
  
  <pre><code>$echo "(..,CAST(0x0000722300000000 AS DateTime),..,CAST(0x0000979900C10112 AS DateTime),...)" | using grep or sed or awk 
  
  (..,myfunc(0x0000722300000000),..,myfunc(0x0000979900C10112),...)
  </code></pre>