Use regular expressions in promotions

If you want a promotion to appear for a variety of highly similar queries, you can use regular expressions to define your trigger queries. For example:

  • pizza \d{5,5} will match any 5-digit postal code queries, like "pizza 98102"
  • digital\scameras? will match the queries "digital camera" or "digital cameras".
 
To dynamically update a promotion URL or title with the content of a user query, use $q

Add a promotion using regular expressions

  1. On the Custom Search home page, click the search engine you want.
  2. Click Search features, and then click the Promotions tab.
  3. Click Add.
  4. Select the Regular expression checkbox.
  5. In the Queries box, type a query that will trigger the display of your promotion. (Note that queries are not case-sensitive.)
  6. When you're happy with your changes, click Publish.
If the Regular expression checkbox is selected, Programmable Search Engine will treat everything typed in the search box (including commas) as a single regular expression.
Search
Clear search
Close search
Google apps
Main menu
9845945608395572006
true
Search Help Center
true
true
true
false
false