Stormcrawler 和 regex 在 default-regex-filters.txt 中解析规则时?

Stormcrawler and regex when parsing rules in the default-regex-filters.txt?

如果我只需要抓取一个域中的一个主机,同时还要抓取我们网站的其余部分,那么要在 default-regex-filters.txt 中放入什么正则表达式来实现?

我试图阻止 https://*.bar.com 上的所有主机,同时仅允许 https://foo.bar.com

我可以做一个通用的 -^https?://.*\.bar\.com.* 规则,然后是允许一个主机的特定规则 +^https?://foo\.bar\.com.* 这样行得通吗?

我尝试做一种复杂的 -^https?://([a-eg-zA-EG-Z0-9] 类型的事情来阻止除 foo 之外的所有内容,但是否定所有内容并添加回我真正想要的内容似乎更简单...

最具体的规则确实应该放在第一位,请参阅代码

https://github.com/DigitalPebble/storm-crawler/blob/399cdac2125c39ef9be26586a2ca2609f92b0988/core/src/main/java/com/digitalpebble/stormcrawler/filtering/regex/RegexURLFilterBase.java#L156

fastURLFilter https://github.com/DigitalPebble/storm-crawler/wiki/URLFilters 遵循相同的逻辑,但组织起来可能更简单。