Python 正则表达式匹配硬编码密钥
可以使用以下正则表达式来匹配硬编码密钥:
import re
regex = r"(?<![a-zA-Z0-9_])([a-zA-Z0-9_]{32})(?![a-zA-Z0-9_])"
str = 'This is a hard-coded key: 1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6'
matches = re.findall(regex, str)
for match in matches:
print('Match found: ' + match)
这个正则表达式将匹配 32 个字符长度的字母、数字或下划线序列,前后不能是字母、数字或下划线,表示硬编码密钥。
原文地址: https://www.cveoy.top/t/topic/n7wY 著作权归作者所有。请勿转载和采集!