title: Using \P{C} in Spark SQL regexp_replace
body: <p>I understand \P{C} represents "invisible control characters and unused code points"
  <a href="https://www.regular-expressions.info/unicode.html" rel="nofollow noreferrer">https://www.regular-expressions.info/unicode.html</a></p>
  
  <p>When I do this, (in a databricks notebook) it works fine:</p>
  
  <pre><code>%sql
  SELECT regexp_replace('abcd', '\\P{C}', 'x')
  </code></pre>
  
  <p>But the following fails (both %python and %scala):</p>
  
  <pre><code>%python 
  s = "SELECT regexp_replace('abcd', '\\P{C}', 'x')"
  display(spark.sql(s))
  
  java.util.regex.PatternSyntaxException: Illegal repetition near index 0
  P{C}
  ^
  </code></pre>
  
  <p>The SQL command also works fine in HIVE.
  I also tried escaping the curly braces as suggested <a href="https://stackoverflow.com/questions/44034232/undocumented-java-regex-character-class-pc">here</a>, but no use.</p>
  
  <p>Is there anything else I am missing? Thanks.</p>