Regex character extraction

I'm experiencing issues with Regex within a Looker Studio table. I have a table column with a dimension that contains both:

  • 'Product name'
  • 'Product name [id]'

I want to use regex to get rid of the '[id]' portion (in other words, only have the product name).
I managed to get a working expression within a regex tester:
afbeelding.png
This matches the correct part in this tester, but when trying this within Looker Studio Regex_Extract I get this error message:

Lennard87_0-1724747990916.png

So how do I actually extract the product name (with a variable number of characters) from this dimension?

Solved Solved
0 1 329
1 ACCEPTED SOLUTION

Hey @Lennard87 

You need 2 back slashes to espace special characters inside Looker Studio. But for your use case, you can do it differently with this formula: 

 

TRIM(REGEXP_EXTRACT("Product name [26]","^[^[]*")

 

View solution in original post