title: Why do I need to use double curly Brackets in my RegEx?
body: <p>I'm running a little regular expression in one of my xsl-transformations (<code>xsl:analyze-string</code>) and came across this effect that made me rather uncomfortable because I didn't really find any explanation...</p>
  
  <p>I was searching for Non-Breaking-Spaces and En-Spaces, so I used the <code>\p{Z}</code> construct. According to many examples in the XSLT 2.0 Programmers Reference by Michael Kay, this should work. RegExBuddy also approves :)</p>
  
  <p>Now my SaxonHE9.4N tells me </p>
  
  <blockquote>
    <p>Error in regular expression: net.sf.saxon.trans.XPathException: expected ({)</p>
  </blockquote>
  
  <p>After several trials and errors I simply doubled the Brackets <code>\p{{Z}}</code> ... and it worked!? But this time RegExBuddy disapproves! </p>
  
  <p>Can someone give me an explanation of this effect? I couldn't find anything satisfying on the internet...</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Edit:</strong> I tried the same thing inside of a <code>replace()</code> function and the double bracket version didn't work. I had to do it with single brackets!</p>