MCPcopy Create free account
hub / github.com/Cats-Team/AdRules / is_regex

Function is_regex

script/remove.py:27–34  ·  view source on GitHub ↗

判断字符串是否包含正则表达式的特殊字符

(line)

Source from the content-addressed store, hash-verified

25 return parser.parse_args()
26
27def is_regex(line):
28 """
29 判断字符串是否包含正则表达式的特殊字符
30 """
31 # 常见的正则特殊字符,注意:点号 '.' 在域名中很常见,
32 # 纯域名通常不包含 *, \, [, ], (, ), ^, $, {
33 regex_chars = {'*', '\\', '[', ']', '(', ')', '^', '$', '{', '}'}
34 return any(char in regex_chars for char in line)
35
36def load_whitelist(file_path):
37 plain_domains = set()

Callers 1

load_whitelistFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected