title: Markloigc : Escape regular expression in fn:replace
body: <p>Can anyone help me how to escape regular expression in fn:replace()</p>
  
  <p>My actual code look like,</p>
  
  <p><strong>Request</strong></p>
  
  <pre><code>let $x := "/SLR/[2009] 3 SLR(R) 0327.xml"
  return
  (
    fn:replace( $x, $x, "Expected Value")
  )
  </code></pre>
  
  <p><strong>Response</strong>: Unexpected response since it has regular expression terms in.</p>
  
  <pre><code>/SLR/[2009] 3 SLR(R) 0327.xml
  </code></pre>
  
  <p>If i escape regular expression manually, i got the result as expected.</p>
  
  <p>like,</p>
  
  <p><strong>Request</strong></p>
  
  <pre><code>let $x := "/SLR/[2009] 3 SLR(R) 0327.xml"
  return
  (
    fn:replace( $x, "/SLR/\[2009\] 3 SLR\(R\) 0327.xml", "Expected Value")
  )
  </code></pre>
  
  <p><strong>Response</strong>: </p>
  
  <pre><code>Expected Value
  </code></pre>
  
  <p>My problem is i cant do manually for 1000 of files i had. </p>
  
  <p>Can any one please help me how to make it easier?</p>