如何才能仅提取各种字符串中引号中的散列数字:
[file:hashes.'MD5' = '547334e75ed7d4eea2953675b07986b4']
[file:hashes.'SHA1' = '82d29b52e35e7938e7ee610c04ea9daaf5e08e90']
[file:hashes.'SHA256' = 'ff3b45ecfbbdb780b48b4c829d2b6078d8f7673d823bedbd6321699770fa3f84']
我需要使用以下脚本提取数字并将其插入到表中:
if item['hash'][:12]=='[file:hashes': #it finds the hash string from Json dic like above lists
if item['hash'][22:-2] not in hash_column: #extracts the digits but only for MD5
insert_hash_table(item['hash'][22:-2]) #insert the hash digit
因此,在上面的例子中,如果‘=’前面的字符串由于不同的散列而改变,那么我将无法与我的代码片段保持一致.有没有办法只提取所有类型散列的引号中‘=’后面的数字?-例如82d29b52e35e7938e7ee610c04ea9daaf5e08e90