title: How can I remove characters in a string after a specific special character (~) in snowflake sql?
body: <p>I am using Snowflake SQL. I would like to remove characters from a string after a special character <code>~</code>. How can I do that?</p>
  
  <p>here is the whole scenario. Let me explain. I do have a string like 'CK#123456~fndkjfgdjkg'. Now, i want only the number after #.And not anything after ~. This is number length varies for that field value. It might be 1 or 5 or 3. And i want to add the condition in where class where this number is equal to check_num from other table after joining. I am trying REGEXP_SUBSTR(A.SRC_TXT, '(?&lt;=CK#)(.+?\b)') = C.CHK_NUM in the where condition. I am getting the error as 'No repititive argument after ?'</p>