j'ai une chaine "<html>hello</html></a>world<body>ok"

et je veu recuperer le texte qui ya dedan en utilisant une regex , ce qui doit me renvoyer helloworldok sans les tags html

j'ai fai un essaye , je suis proche mais aussi loin de la solution !!!!

voila mon code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
>>> from re import findall
>>> chaine = """<html>hello</html></a>world<body>ok"""
>>> print findall('[a-z].*?[^\<\>][a-z]',chaine)
['htm', 'l>he', 'llo', 'htm', 'l></a', 'wor', 'ld<bo', 'dy>ok']
>>>
ce serai quoi la bonne regex ? a votre avis ?


Merci