Giter Club home page Giter Club logo

Comments (14)

entr0pia avatar entr0pia commented on August 28, 2024

我直接title/.*小.(百科|知识)网.*/, 简单粗暴

from google-chinese-results-blocklist.

tjsky avatar tjsky commented on August 28, 2024

你测试加$有效吗?
我测试的插件只响应了^,对$不会响应。

from google-chinese-results-blocklist.

entr0pia avatar entr0pia commented on August 28, 2024

你测试加有效吗?我测试的插件只响应了,对有效吗? 我测试的插件只响应了^,对不会响应。

不需要限制位置啊, 全局范围内匹配到直接屏蔽就行了

from google-chinese-results-blocklist.

kurikomoe avatar kurikomoe commented on August 28, 2024

你测试加 $ 有效吗? 我测试的插件只响应了 ^,对 $ 不会响应。

我测试是有效的:

测试:检查 $ 会不会影响到匹配结果。

  1. 正样本
title/^.*-\s*..(百科|知识)\s*网$/
title/^小.(百科|知识)网$/
title/^.小(百科|知识)网$/

image

  1. 负样本(去掉
title/^.*-\s*..(百科|知识)\s*$/
title/^小.(百科|知识)$/
title/^.小(百科|知识)$/

image

from google-chinese-results-blocklist.

kurikomoe avatar kurikomoe commented on August 28, 2024

你测试加有效吗?我测试的插件只响应了,对有效吗? 我测试的插件只响应了 ^,对不会响应。

不需要限制位置啊,全局范围内匹配到直接屏蔽就行了

从广泛订阅的公有 rules 来讲,应该尽可能地精确匹配;全局只要出现特定模式的这种容易造成误伤,而且一旦出现误伤会波及到很多人。

from google-chinese-results-blocklist.

entr0pia avatar entr0pia commented on August 28, 2024

你测试加有效吗?我测试的插件只响应了,对有效吗? 我测试的插件只响应了 ^,对不会响应。

不需要限制位置啊,全局范围内匹配到直接屏蔽就行了

从广泛订阅的公有 rules 来讲,应该尽可能地精确匹配;全局只要出现特定模式的这种容易造成误伤,而且一旦出现误伤会波及到很多人。

学习了

from google-chinese-results-blocklist.

tjsky avatar tjsky commented on August 28, 2024

我当时没加 ^是因为有些抓取站会二次抓这些某某百科网,
导致实际页面标题“含有”而不是“匹配”balabala - 小x知识网 格式的尴尬情况,
所以我写成了title/.* - 小.(百科|知识)网/
测试了下也没什么误杀
含有【**** - 小*知识网】这个格式已经有足够的防误杀特征了

title/小.(百科|知识)网/这个写法确实有一定的误杀风险,感觉上最好移除这个规则。
毕竟正常用户不会直接去搜这些站的名字吧。。。
这个规则基本只会在直接搜抓取站的名字时起作用。

用你的规则,再用域名屏蔽其他二次抓取站确实会更好一点
毕竟正则这玩意一贯的特征就是:写一个可以匹配某内容的规则容易,写一个只匹配某内容的规则就需要费点劲了。
我倾向于这样写
title/^.*[ ]-[ ]小.(百科|知识)网$/
title/^小.(百科|知识)网$/

用[ ]去匹配空格,而不是\s
\s指的是空白,不仅仅是空格这一种,回车换行tab这都算\s

from google-chinese-results-blocklist.

cobaltdisco avatar cobaltdisco commented on August 28, 2024

Hi @kurikomoe

不知道“另外希望能把正则匹配规则,url 匹配规则等单列出来”的原因是?是觉得之后调整规则会相对容易?

from google-chinese-results-blocklist.

kurikomoe avatar kurikomoe commented on August 28, 2024

Hi @kurikomoe

不知道“另外希望能把正则匹配规则,url 匹配规则等单列出来”的原因是?是觉得之后调整规则会相对容易?

正则的杀伤力比较大,分开一方面方便用户选择是否用正则匹配(普通规则,强力规则),另一方面感觉比较有条理一些。

from google-chinese-results-blocklist.

cobaltdisco avatar cobaltdisco commented on August 28, 2024

Hi @kurikomoe
不知道“另外希望能把正则匹配规则,url 匹配规则等单列出来”的原因是?是觉得之后调整规则会相对容易?

正则的杀伤力比较大,分开一方面方便用户选择是否用正则匹配(普通规则,强力规则),另一方面感觉比较有条理一些。

好的,已经修改。

from google-chinese-results-blocklist.

cobaltdisco avatar cobaltdisco commented on August 28, 2024

Hi @kurikomoe @tjsky

目前看来:

  1. title/^小.(百科|知识)网$/ 来代替 title/小.(百科|知识)网/ 来降低误杀,会进行规则更新。
  2. title/^.小(百科|知识)网$/ 匹配的是 X 小百科、知识网,似乎没有必要?
  3. title/^.*[ ]-[ ]小.(百科|知识)网$/ 来代替 title/.* - 小.(百科|知识)网/,不过有个疑问,为什么是要用 [ ] 来代替空格?

from google-chinese-results-blocklist.

kurikomoe avatar kurikomoe commented on August 28, 2024

Hi @kurikomoe @tjsky

目前看来:

  1. title/^小.(百科|知识)网$/ 来代替 title/小.(百科|知识)网/ 来降低误杀,会进行规则更新。
  2. title/^.小(百科|知识)网$/ 匹配的是 X 小百科、知识网,似乎没有必要?
  3. title/^.*[ ]-[ ]小.(百科|知识)网$/ 来代替 title/.* - 小.(百科|知识)网/,不过有个疑问,为什么是要用 [ ] 来代替空格?

因为单纯的空格可读性有点低 a b vs a[ ]b

我自己写正则习惯性的空格用 [ ] 来代替,防止键入和以后读正则的时候忘记这里有一个空格。

from google-chinese-results-blocklist.

tjsky avatar tjsky commented on August 28, 2024

Hi @kurikomoe @tjsky

目前看来:

  1. title/^小.(百科|知识)网$/ 来代替 title/小.(百科|知识)网/ 来降低误杀,会进行规则更新。
  2. title/^.小(百科|知识)网$/ 匹配的是 X 小百科、知识网,似乎没有必要?
  3. title/^.*[ ]-[ ]小.(百科|知识)网$/ 来代替 title/.* - 小.(百科|知识)网/,不过有个疑问,为什么是要用 [ ] 来代替空格?

因为就是如@kurikomoe 所说,是为了防止因为字体、字间距之类的问题,导致以后维护时没看出来这里有个空格存在。
是个增强正则可读性的措施

from google-chinese-results-blocklist.

cobaltdisco avatar cobaltdisco commented on August 28, 2024

Hi @kurikomoe @tjsky

感谢,已经更新。

from google-chinese-results-blocklist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.