import re
s1 = '[2020-08-10 15:39:54][/sdcard/XZ_Pay/Log/][1410]存款机芯指令 CIM_Deposit1:0_amount:2000_countingInfo:100 KL75652418&100 E6S9549928&100 MR02222661&100 F1H6406114& 50 RY23212014&100 CK78501286&100 UM02606526&100 B26R384248&100 MT24254172&100 E8Q2689387&100 Q4F1943476&100 KJ29198589&100 ES52825575&100 BL32258602&100 Z9Z5397319& 50 ZZ16997063& 50 RY25753241& 50 QP20289259& 50 TP99731738& 50 AJ50529175& 50 AJ50529176& 50 AJ50529184& 50 WW70182203& 50 ZU05399582& 50 AJ50529173& 50 ZZ18675992'
l1 = s1.split('countingInfo:100')
s2 = str(l1[1])
print(s2)
p = r'.{10}&'
a1 = re.findall(p,s2)
print(a1)
ss1 ='[2020-08-10 12:04:03][/sdcard/XZ_Pay/Log/][1431]存款机芯指令 CIM_Deposit1:0_amount:6300_countingInfo:100 F1H6406114&100 RY49201669&100 C1C9010607&100 NH98992853&100 R13R455483&100 Q2F1305710&100 C48Y122858&100 D16F432848&100 OQ92484666&100 H1S5351512&100 TG30290333&100 UC72740444&100 B85G439151&100 LJ14528985&100 W2P2494711&100 YB67392466&100 C8J9223162&100 ZS46502380&100 P3D3379352&100 F1H6406112&100 F1H6406111&100 KL15410966&100 UC94912274&100 Q8F9086681&100 NN15035955&100 J9B9910714&100 Q7D6438088&100 KL10053493&100 R98Q011621&100 PJ79169862&100 W4D2206770&100 YJ41770140&100 DE87013442&100 S1D3647269&100 N11W266076&100 RY71022314&100 NM74324965&100 D66S125680&100 QX08357167&100 PW34192470&100 H0Q0656785&100 DB87703139&100 Q6A4843745&100 BF92813990&100 G3Q5527871&100 Q2B4440591&100 EK40906881&100 UP00455729&100 NK19194466&100 JZ09566683&100 U4K0925665&100 BP16919474&100 HL26038607&100 E0P2635279&100 EP02178809&100 EP48474427& 50 RT34693825&100 GU04240403&100 RY07833996& 50 WY29677864& 50 QB32426262&100 X52P944159& 50 QQ57601424&100 G3Q5527873&100 XN89985111'
ll1 = ss1.split('countingInfo:100')
ss2 = str(ll1[1])
print(ss2)
p = r'.{10}&'
aa1 = re.findall(p,ss2)
print(aa1)
print('--------------------')
for each in aa1:
if each in a1:
print(each)
大概写了一个,两组之间的找重复。