Marketing Analytics in Google Sheets
Luke Pajer
Digital Marketing Specialist
string
, regular expression
, replacement string
)
.[u|U]sers
: Replaces the word 'Users' after the strings R and Python''
to delete the word entirely=REGEXREPLACE(`string`, `regular expression`, '')
string
, regular expression
)
()
indicate the group of characters to extractPython Users
(.*).Users
returns Python
(.*).[u|U]sers
would extract 'Python' and 'R' from the campaign names(.*)
matches the part of the string to extract.[u|U]sers
is the part of the string to match, but not extractTo replace only a certain categorical string:
=IF(REGEXMATCH(test, regex), REGEXREPLACE(string, regex, replacement string), if False)
To extract only a certain categorical string:
=IF(REGEXMATCH(test, regex), REGEXEXTRACT(string, regex), if False)
Marketing Analytics in Google Sheets