title: Spark SQL - Regex for matching only numbers
body: <p>I am trying to make sure that a particular column in a dataframe does not contain any illegal values (non- numerical data). For this purpose I am trying to use a regex matching using <code>rlike</code> to collect illegal values in the data:</p>
  
  <p><a href="https://i.stack.imgur.com/lCjTM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lCjTM.png" alt="enter image description here"></a></p>
  
  <p>I need to collect the values with string characters or spaces or commas or any other characters that are not like numbers. I tried:</p>
  
  <pre><code>spark.sql("select * from tabl where UPC not rlike '[0-9]*'").show()
  </code></pre>
  
  <p>but this doesn't work. it produces 0 rows.</p>
  
  <p>Any help is appreciated. Thank you.</p>