简体   繁体   English

SQL 和雪花中的正则表达式

[英]REGULAR EXPRESSIONS IN SQL AND SNOWFLAKE

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:所需 OUTPUT:

1234 Pharmacy

Using REGEXP_REPLACE:使用 REGEXP_REPLACE:

SELECT REGEXP_REPLACE('1234 Pharmacy #344455', '\\W*\\d*$') 
-- 1234 Pharmacy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM