How can I clean HTML tags out of a ColdFusion string?

前端 未结 6 1712
南方客
南方客 2021-02-14 00:16

I am looking for a quick way to parse HTML tags out of a ColdFusion string. We are pulling in an RSS feed, that could potentially have anything in it. We are then doing some man

6条回答
  •  醉梦人生
    2021-02-14 00:47

    The best way is usually to coerce < to < and > to >. This way you aren't making assumptions about the nature of the message. Somebody may be talking about or trying to be <> or describing a keystroke +C or using maths 1 < x > 3. Even smilies could trigger the regex <8P X>

    
        ', '<,>')>
    
    

提交回复
热议问题