示例1
asdk[wovkd'vk'psacx
的 U5 = 205478499 | 205477661 zamd;amd;a;d
示例2
sadlmdlmdadsld
的 U5 = 205478499 | 205477661 | 234567899 amsd/samdamd
u5可以将多个值分隔为|
如何从我拥有的长字符串中捕获所有u5值?
答案 0 :(得分:2)
以下是BigQuery Standard SQL
#standardSQL
WITH data AS (
SELECT 1 AS id, "asdk[wovkd'vk'psacxu5=205478499|205477661zamd;amd;a;d" AS junk UNION ALL
SELECT 2, "sadlmdlmdadsldu5=205478499|205477661|234567899amsd/samdamd"
)
SELECT id, SPLIT(REGEXP_EXTRACT(junk, r'(?i)u5=([\d|]*)'), '|') AS value
FROM data
输出如下
id value
1 205478499
205477661
2 205478499
205477661
234567899