问题原文
原帖链接 · Kaf · CC BY-SA 4.0
Emails containing: blablabla.icu/blabla should be blocked. I get confused with this rule to block and emails that contain a link which address finish with .icu/:
/.*\.icu\/*./ Reject
The problem is that any emails, including attachments, that contains anything.icuabacadada are also blocked.
It seems the second \ before the / is not working as intent. Any suggestions how to fix this?
已采纳解答
原帖链接 · asdmin · CC BY-SA 4.0
Let me just take the regex out of your question:
/.*\.icu\/*./
^^ (A) this part is not needed
^^^^^ (B) this matches .icu
^^^ (C) this matches 0, 1, 2 or any number of /
^ (D) this matches 1 character (any of them)
To get to the proper regex, you need to
- remove A (to improve performance)
- keep B
- modify C to describe one
/character - drop D (I presume it was placed here by a mistake, perhaps you mixed
.*to*.?
So the proper regexp is:
/\.icu\//
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
