I’m trying to understand how to do a replace of a string that also contains html code (in ColdFusion).
The function must not look (or replace) for inside html tags.
Thank you.
Let me be more specific:
should not search inside the img and a tag
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ColdFusion only deals with strings, it doesn’t know anything about “HTML”, it just sees “string data”. So thee’s nothing native in ColdFusion to help you.
I haven’t tried this, but you could perhaps use jsoup to convert the string into a usable DOM document, then you will be able to distinguish between tags and text.