【问题标题】:Regular expression in bigquerybigquery 中的正则表达式
【发布时间】:2016-06-08 19:50:07
【问题描述】:

我想对包含特定单词的所有记录进行分组。 EX:在 excel 中,当我们在 contains 中给出一个词时,拟合器是如何工作的。 例如: 手机1, 移动的, 移动的, 45-移动, 移动台。 我想要所有包含移动的记录

【问题讨论】:

  • 您需要提供更多信息。

标签: regex google-bigquery


【解决方案1】:

我觉得实际上你的任务在某种程度上更复杂 - 但是你呈现它的方式使它看起来相对简单 - 你甚至不需要这里的正则表达式
检查下面的例子

SELECT 
  line
FROM 
  (SELECT 'I want to group all          ' AS line),
  (SELECT 'the records that             ' AS line),
  (SELECT 'contains a particular word.  ' AS line), 
  (SELECT 'EX: in excel how the fiter   ' AS line), 
  (SELECT 'works when we give a word    ' AS line), 
  (SELECT 'in the contains. Eg: mobile1,' AS line),
  (SELECT 'mobile,                      ' AS line), 
  (SELECT 'Mobile,                      ' AS line), 
  (SELECT '45-mobile,                   ' AS line), 
  (SELECT 'mobile station.              ' AS line), 
  (SELECT 'i want all the records       ' AS line), 
  (SELECT 'that contains mobile         ' AS line),
WHERE LOWER(line) CONTAINS 'mobile'

【讨论】:

    猜你喜欢
    • 2023-03-08
    • 2013-06-10
    • 2013-12-05
    • 2013-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多