mrf8
mrf8

Reputation: 45

REGEXP_EXTRACT Data Studio

I have those type of strings in Data Studio:

Car;House;I have a car in my house
Mobile;Phone;She has a mobile phone

And I would like to get the last sentences: "I have a car in my house" , "She has a mobile phone". I am trying with extract the last sentence up ; but I can't get it with REGEXP_EXTRACT or REGEXP_MATCH

Upvotes: 0

Views: 196

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521409

REGEXP_EXTRACT with a capture group should work here. We can select semicolon followed by any non semicolon content, which should coincide only with the final sentence.

REGEXP_EXTRACT(String, ';([^;]+)$')

Demo

The demo link above is just a pure regex demo, but it shows the capture group selecting the last sentence in the input.

Upvotes: 2

Related Questions