REGEX_MATCH模式可在除Google Data Studio之外的任何地方使用 [英] REGEX_MATCH pattern works everywhere but Google Data Studio

查看:70
本文介绍了REGEX_MATCH模式可在除Google Data Studio之外的任何地方使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解Google Data Studio中 REGEX_MATCH 中使用的REGEX的实现.我有一个非常简单的模式,它不会在Google Data Studio中匹配,但是会在BigQuery和 regexr.com等网站上成功

I am trying to understand the implementation of REGEX used in REGEX_MATCH in Google Data Studio. I have a pretty simple pattern that just won't match in Google Data Studio but will succeed in BigQuery and on sites such as regexr.com

要匹配的字符串的格式为:

The string to match is of the format:

some.job.run |成功:[{"object_1":20},{"object_2":0}] (列表中有更多项)

在BigQuery中,我可以将预期结果与:

In BigQuery I can match the expected results with:

REGEXP_MATCH(input,'^ some \\.job \\.run \\ | SUCCESS \\:.*')

这在Google Data Studio中被认为是有效的,但不会匹配,我之前读过Google Data Studio需要完整的字符串匹配-我确实在BigQuery和

This is accepted as valid in Google Data Studio but will not match, I had previously read that Google Data Studio requires a full string match - which I do get in BigQuery and regexr.com etc.

在Google Data Studio中使用过 REGEX_MATCH 的任何人都能阐明为什么该模式在Google Data Studio中不匹配吗?

Is anyone experienced using REGEX_MATCH in Google Data Studio able to shed some light on why this pattern won't match in Google Data Studio?

推荐答案

您正在使用旧版SQL( REGEXP_MATCH ).尝试使用标准SQL( REGEXP_CONTAINS ),它应该可以解决此问题.

You're using legacy SQL (REGEXP_MATCH). Try with Standard SQL (REGEXP_CONTAINS) and that should fix it.

https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#regexp_contains

这篇关于REGEX_MATCH模式可在除Google Data Studio之外的任何地方使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆