strip tags python

后端 未结 9 1636
深忆病人
深忆病人 2020-12-17 23:07

i want the following functionality.

input : this is test  bold text  normal text
expected output: this is test normal text
9条回答
  •  星月不相逢
    2020-12-17 23:37

    Try with:

    import re
    input = 'this is test  bold text  normal text'
    output = re.compile(r'<[^<]*?/?>').sub('', input)
    print output
    

提交回复
热议问题