sql – Regex for characters after a symbol
I have a string something like this –
dlYrZLo6HHxROSHDOWZHkh|
I would like to remove the | symbol from this string and it should be – dlYrZLo6HHxROSHDOWZHkh.
However, if I get a string like this
3nXfYzpMktzk4EXnur3Zgc|iDCvlu0TJOIp2WCEwgAQmM
it should remain untouched. The regex I am using here is
^[A-Za-z0-9]+|$ and my HANA SQL query looks as below
select
replace_regexpr('^[A-Za-z0-9]+|$' in "id" with '\1' OCCURRENCE ALL)
from TABLE1
However, I see the below results
May I know where am I going wrong here?
Read more here: Source link

