Complicated variables/RegEx question
Hello~
I have a form that allows users to submit a block of text, with any variables they want to use surrounded by ~, like ~firstName~. The entire block of text, including the variables, is being outputted to the page. I have a RegEx function that replaces all of the ~ with #, but I still can't get the variables to show up as their values, rather than #firstName# on the page.
Here is my RegEx expression:
<cfset content = reReplace(content,'[~]','##','ALL') />
This gets me this when I output the whole variable to the page:
<p>Dear #firstName# #lastName#:</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras nec accumsan ante. Mauris placerat ullamcorper lorem mollis fringilla. Morbi non urna ipsum, et tempus urna. Aliquam pellentesque sapien ut orci lacinia vitae faucibus enim ullamcorper.</p>
<p>Sincerely,<br />#clientName#</p>
<p><a href="#webSite#">Click here</a> to return to our Web site.</p>
I have been playing around with reReplace to add single quotes around non-variable text, and ampersands, etc., to make it all work, but I haven't had much luck! Any suggestions would be really helpful. Thanks!
KC
