Answered
replace exact string only
I'm outputting text content to my page by querying our
database using a simple method, which works fine.
I need to replace certain words to make them bold, for example...
This works, but there is a slight issue, because it will also replace occurances of the word 'phrase' even if it is within another word...
for example, co phrasetastic
So i need to replace only the exact phrase when used on it's own.
My problem appears quite simple, but I have not found a way to do this...?
quote:
<cfoutput query="getPageContent" startrow="#vPageContent#" maxrows="1">#vContent#</cfoutput>
I need to replace certain words to make them bold, for example...
quote:
<cfset request.vContent = replace(request.vContent, "phrase", "<B>phrase</B>, "ALL")>
This works, but there is a slight issue, because it will also replace occurances of the word 'phrase' even if it is within another word...
for example, co phrasetastic
So i need to replace only the exact phrase when used on it's own.
My problem appears quite simple, but I have not found a way to do this...?
