Find the 4th last object in this campaign
-
My campaigns all follow the same naming convention, i am trying to use a Regex_Extract formula in DataStudio to create a new custom dimension that only displays the 4th last element in the below campaign: "ctatext" Each element is separated by a _
channel_product_country_medium_brand_offer_campaignname_ctatext_date_objective_0
Closest i have gotten is:
REGEXP_EXTRACT(Session campaign, '(.+){4}(?:[^_]+.)')
but that only returns the 4th character in the string .. can anyone help ?
-
My campaigns all follow the same naming convention, i am trying to use a Regex_Extract formula in DataStudio to create a new custom dimension that only displays the 4th last element in the below campaign: "ctatext" Each element is separated by a _
channel_product_country_medium_brand_offer_campaignname_ctatext_date_objective_0
Closest i have gotten is:
REGEXP_EXTRACT(Session campaign, '(.+){4}(?:[^_]+.)')
but that only returns the 4th character in the string .. can anyone help ?
How about something like:
_([^_]+)(_[^_]*){3}$
regex101: build, test, and debug regex[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
How about something like:
_([^_]+)(_[^_]*){3}$
regex101: build, test, and debug regex[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Oh yes that has helped, thank you very much!