【发布时间】:2021-08-11 09:10:23
【问题描述】:
我正在尝试从此文本格式xx.xx.xx.xx 中提取第四个数字,例如(7.0.3.10),所以我使用了这个
REGEXP_EXTRACT(applicationVersion, r'[^.]*\.[^.]*\.[^.]*\.([^.]*)'
但有时最后一个参数是字符串而不是数字,例如7.0.10.1_chargable,我试图找到一种方法来忽略数字后面的参数,所以我会得到1
SELECT
REGEXP_EXTRACT(applicationVersion, r'[^.]*\.[^.]*\.[^.]*\.([^.]*)') ,
applicationVersion,
max(eventTimestamp)
FROM
`datascience.AppEvents`
group by 1,2 order by 2 desc
我需要进行哪些更改才能获得此结果?
【问题讨论】:
标签: regex google-bigquery