关于在 Search Console 中使用正则表达式的更新信息和简要提示
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
2021 年 6 月 2 日,星期三
最近,我们宣布改进了 Search Console 效果报告的数据过滤功能,我们很高兴看到社区对这项公告的反响。
像往常一样,我们也非常关注收到的反馈。我们收到许多请求,希望向正则表达式过滤器中添加否定匹配选项来完善这项功能。
我给大家带来了一个好消息:从今天起,效果报告过滤器将同时支持匹配和不匹配正则表达式过滤器。在过滤器选择器中选中“自定义(正则表达式)”选项后,相关选项即会在次级下拉菜单中显示,具体如以下屏幕截图所示。详细了解如何过滤搜索效果数据。
关于在 Search Console 中使用正则表达式的简要提示
如果您刚开始使用正则表达式,我们认为下面的简要提示可能会对您有所帮助。
首先,正则表达式是什么?简单地说,正则表达式是指定搜索模式的一系列字符。您可以使用它创建高级过滤器,以便包含或排除比字词或短语更复杂的内容。使用正则表达式时,您可以使用一些元字符,即具有特殊含义的字符,例如定义搜索条件的字符。有关 Search Console 支持的所有元字符,请参阅 RE2 正则表达式语法参考文档。
如果您希望了解何时应使用正则表达式而非其他类型的过滤器,下面的几个示例展示了何时应使用正则表达式,而不是其他过滤器:
- 细分已经知道您的品牌的用户 - 您可以使用正则表达式指定公司名称的多个变体(包括拼写错误)。这样,您就可以了解每个用户组使用的查询类型,以及每个受众群体被您网站的哪个板块吸引。举例来说,假如您的公司名称为
Willow Tree
,您可能需要为所有变体创建一个过滤器,例如:willow tree|wilow tree|willowtree|willowtee
(|
元字符表示 OR 语句)。
- 分析网站版块的流量 - 您可以使用正则表达式关注您网站上的特定目录,这有助于您了解针对每种内容领域的常见查询。举例来说,假如您的网址结构是
example.com/[product]/[brand]/[size]/[color]
,您希望查看指向绿色鞋子的流量,但您不关注品牌或尺寸,则可以使用 shoes/.*/green
(.*
会不限次数地匹配任意字符)。
- 了解用户意图 - 您可以使用正则表达式分析哪些类型的查询会将用户引导至网站的不同版块。例如,您可能对包含提问词的查询感兴趣,查询过滤器
what|how|when|why
返回的结果有助于您了解哪些内容能够轻松解答疑问(可能是 FAQ)。另一个示例是包含(或不包含)事务性字词(如 buy|purchase|order
)的查询。使用这些正则表达式也能帮助您了解较常用或较少用的产品名称。
有关常用的正则表达式,请参阅 Search Console 帮助中心。如果您在使用正则表达式方面有任何精彩的示例应用,可以在 Twitter 上使用 # 标签 #performanceregex
分享给大家。
如果您有任何问题或疑虑,欢迎通过 Google 搜索中心社区或 Twitter 联系我们。
发布者:Google 搜索宣讲师 Daniel Waisberg
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
[null,null,[],[[["\u003cp\u003eGoogle Search Console's Performance report now supports negative matching for regular expression filters, allowing users to exclude specific patterns.\u003c/p\u003e\n"],["\u003cp\u003eRegular expressions (regex) are sequences of characters used for advanced filtering beyond simple keywords, enabling analysis of various aspects of website traffic.\u003c/p\u003e\n"],["\u003cp\u003eRegex in Search Console can be used for tasks like segmenting users based on brand knowledge, analyzing traffic to specific website sections, and understanding user intent through query patterns.\u003c/p\u003e\n"],["\u003cp\u003eUsers can leverage the RE2 regex syntax and refer to Search Console help center for guidance on using regular expressions effectively.\u003c/p\u003e\n"]]],["The Search Console Performance report now supports both matching and non-matching regular expression (regex) filters via a secondary dropdown. Regex allows for advanced filtering using metacharacters, enabling users to segment branded traffic, analyze specific website sections (e.g., using `shoes/.*/green`), and understand user intent by filtering for question words or transactional terms (e.g `buy|purchase|order`). The document provides guidance, a link to the RE2 syntax, and encourages the sharing of regex examples.\n"],null,["# Search Console regex filters update and quick tips\n\nWednesday, June 02, 2021\n\n\nWe recently announced [improved data filtering](/search/blog/2021/04/performance-report-data-filtering)\nfor Search Console Performance reports, and we were delighted to see the [community\nreaction](https://twitter.com/googlesearchc/status/1379775388193320962) to the announcement.\n\n\nWe were also interested in the feedback we received, as always, and we saw many requests to complete the picture by adding a negative match option\nto the regular expression (regex) filter.\n\n\nThe good news is that starting today **the Performance report filter supports both matching and not matching regex filters** . The option\nis available through a secondary dropdown, which appears after picking the \"Custom (regex)\" option in the filter selector, as shown in the screenshot\nbelow. Learn more about [filtering search performance data](https://support.google.com/webmasters/answer/7576553#filteringdata).\n\n\nQuick tips on using regex on Search Console\n-------------------------------------------\n\n\nWe also thought it would be helpful to provide some quick tips if you're just starting with regex.\n\n\nFirst of all, what *is* a regular expression? In a few words, it is a sequence of characters that specifies a search pattern. You can use it\nto create advanced filters to include or exclude more than just a word or a phrase. When using regex, you can use a number of metacharacters, which are\ncharacters that have a special meaning, such as defining a search criteria. Check the [RE2 regex\nsyntax reference](https://github.com/google/re2/blob/main/doc/syntax.txt) for a reference on all metacharacters supported by Search Console.\n\n\nIf you're wondering when you should use regex as opposed to other filter types, here are a few examples when to use regex instead of other filters:\n\n- **Segment users that already know your brand** - Use regex that specify multiple variants of your company name, including misspellings. This will inform you what type of queries each group is using and which section of your website is attracting each audience. For example, if your company's names is `Willow Tree`, you might want to create a filter for all variants like this: `willow tree|wilow tree|willowtree|willowtee` (the `|` metacharacter represents an OR statement).\n- **Analyze traffic to a website section** - Use regex that focus on specific directories on your website, this can help you understand what are common queries for each of your content areas. For example, if your URL structure is `example.com/[product]/[brand]/[size]/[color]` and you'd like to view traffic leading to green shoes, but you don't care about the brand or the size, you might use `shoes/.*/green` (`.*` matches any character any number of times).\n- **Understand user intent** - Use regex to analyze which types of queries are bringing users to different sections of your website. For example, you might be interested in queries containing question words; a query filter `what|how|when|why` might show results that indicate your content should easily answer questions, maybe through an FAQ. Another example would be queries containing (or not) transactional words such as `buy|purchase|order`. This might also show which product names are more commonly or rarely used with these expressions.\n\n\nCheck the Search Console help center for [common regular\nexpressions](https://support.google.com/webmasters/answer/7576553#regexp_glossary). If you have any cool examples of what to use regex for, share them on Twitter using the hashtag `#performanceregex`.\n\n\nIf you have any questions or concerns, please reach out on the [Google Search Central Community](https://support.google.com/webmasters/threads?thread_filter=(category:search_console)) or on [Twitter](https://twitter.com/googlesearchc).\n\n\nPosted by [Daniel Waisberg](https://www.danielwaisberg.com), Search Advocate"]]