开始使用免费开始使用

Extract brand campaign names using REGEXEXTRACT()

After some discussions with the social media marketing team, the digital marketing director decided to simply remove the terms Brand or Branded from each of the campaign names.

This is where you come in. You know how to replace using regex but, this time, you will be using REGEXEXTRACT() to pull all the characters not equal to Brand. For example, after the extraction, DataCamp Brand will become DataCamp.

To perform this extraction, you will need to write a new regular expression. As an example, the regex (.*).Expressions extracts any number of characters preceding the text and period, (i.e. Regular would be extracted from Regular Expressions).

本练习是课程的一部分

在 Google Sheets 中进行营销分析

查看课程

练习说明

  • A regular expression in cell I2 that will match any branded campaign (i.e. containing Brand) is already written for you in cell I2.
  • In cell I3, write another regular expression to extract the group of characters not equal to Brand. Refer to the example above for a starting point!
  • Modify the current IF() statement in cell F2 by replacing the second argument, "REGEXEXTRACT", with a REGEXEXTRACT() function.
    • The function should contain two arguments: the input text (in this case, B2), and the cell of your extract pattern.
  • Apply the formula to the remainder of the cells, F3:F29. Make sure that your pattern (I3) is an absolute reference!

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习