2009-08-31 5 views

Répondre

0

dans sa forme simpliest

import re 
clean = re.sub("</?[^\W].{0,10}?>|\n|\r\n", "", your_html) #remove tags and newlines 
key = re.search(r'BEGIN PGP PUBLIC KEY BLOCK.+?END PGP PUBLIC KEY BLOCK', clean) 

ou si vous n'avez pas besoin BEGIN PGP ... BLOCK et END PGP ... BLOCK:

key = re.search(r'BEGIN PGP PUBLIC KEY BLOCK----(.+?)----END PGP PUBLIC KEY BLOCK',clean) 

est ce que vous cherchez? (Je n'ai pas python ici pour le vérifier, mais j'espère que c'est OK)

Questions connexes