【发布时间】:2020-07-29 17:32:11
【问题描述】:
我正在尝试从 URL 中提取 item_subtype 字段。
此正则表达式在获取第一项 item_type 时工作正常
SELECT REGEXP_EXTRACT('info?item_type=icecream&item_subtype=chocolate/cookies%20cream,vanilla&page=1', r'item_type=(\w+)')
但是什么是正确的正则表达式来获取从“巧克力”开始一直到“&page1”之前的所有内容
我已经尝试过了,但似乎无法让它更进一步
SELECT REGEXP_EXTRACT('info?item_type=icecream&item_subtype=chocolate/cookies%20cream,vanilla&page=1', r'item_subtype=(\w+[^Z])')
基本上,我想提取 'chocolate/cookies%20cream,vanilla'
【问题讨论】:
标签: sql regex google-bigquery