I have a string and I want to remove all the digits and punctuations from the end of the string. I doing this on Snowflake
STRING:
1234 Pharmacy #344455
DESIRED OUTPUT:
1234 Pharmacy
Using REGEXP_REPLACE:
SELECT REGEXP_REPLACE('1234 Pharmacy #344455', '\\W*\\d*$')
-- 1234 Pharmacy
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.