Search code examples
looker-studiore2

Regexp_extract using Google re2


I need to extract the following text string using google/re2: Audiences » Affinity Categories » Food & Dining » Fast Food Cravers

In sum, any string after no.3 »

Would appreciate any help/ guidance, million thanks!

best, yg


Solution

  • The following Regular Expression extracts the 3rd string:

    (?:[^»]+?»){3}\s*(.+?)\s*[\nÂ]
    

    You can test it interactively here.

    enter image description here

    I haven't actually used re2 before so keep in mind possible syntax differences.