Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我读了一篇关于检测base64的正则表达式的文章,但是当我在“yara python”中尝试它时,它给出了“未终止的正则表达式”的错误,正则表达式是:
(?:[A-Za-z0-9+/]{4}){2,}(?:[A-Za-z0-9+/]{2}[AEIMKUYcgkosw048]=|[A-Za-z0 -9+/][AQgw]==)
有人可以提出建议吗?谢谢
这个对我有用:
>>> import re >>> re.compile(r'(?:[A-Za-z0-9+/]{4}){2,}(?:[A-Za-z0-9+/]{2}[AEIMQUYcgkosw048]=|[A-Za-z0-9+/][AQgw]==)') <_sre.SRE_Pattern object at 0x2865c40>
我建议/在块中转义字符[A-Za-z0-9+/],因为在未转义时它定义了正则表达式开始/结束。
/
[A-Za-z0-9+/]