【发布时间】:2021-12-28 17:04:21
【问题描述】:
所以我使用的是 Snowflake,特别是 REGEXP_REPLACE 函数。我正在寻找一个正则表达式,它将匹配文本字段中带有@符号的任何单词。
例子:
| RAW_DATA | CLEANED_DATA |
|---|---|
| here is a sample and then an email@gmail.com | here is a sample and then an xxxxx |
| abc@test.com | xxxxx |
到目前为止我尝试过的是:
Select regexp_replace('ABC@gmail.com' , '(([a-zA-Z]+)(\W)?([a-zA-Z]+))', 'xxxxxxx') as result;
结果:
xxxxxxx@xxxxxxx.xxxxxxx
【问题讨论】:
标签: sql regex snowflake-cloud-data-platform