REGEXP_CONTAINS order and Case statement in bigquery

前端 未结 1 822
庸人自扰
庸人自扰 2021-01-29 05:41

I\'m using case statement and REGEXP_CONTAINS.Just wanted to see if the following order will give me the correct output.

 (CASE 
 WHEN REGEXP_CONTAINS(AdSet, \'(?         


        
相关标签:
1条回答
  • 2021-01-29 06:27

    Seems correct if you want case insensitive search for the keyword, while in general, string functions are more efficient than REGEX functions, consider to:

    REGEXP_CONTAINS(AdSet, '(?i)BUS') THEN "BUS"
    
    =>
    
    STRPOS(UPPER(AdSet), 'BUS') <> 0 THEN "BUS"
    
    0 讨论(0)
提交回复
热议问题