I need to pass the whole string into the function as i want to replace every
character in the email address with its&# value so i need to be able to
evaluate the back references to the values of the back references are passed
into the function

  _____  

From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Blair McKenzie
Sent: Thursday, 23 August 2007 10:10 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Evaluating regular expression back references


If you're only replacing symbols you don't really need regex.
For most symbols, just replace them with their &## counterpart:
replacelist(str, "@,%", "&#asc('@')#,&#asc('%')#") 

If you need to replace &s you need to make sure to do so before any other
symbols.

Blair


On 8/22/07, Steve Onnis <  <mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED]> wrote: 



What I am trying to do is replace all values in a string with the &# value 
of the character.  This is what I have so far...

-----------------------------------------------------------
<cfsavecontent variable="str">
        this is my email address <a
href="mailto: [EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
</cfsavecontent>
<cfset reg = "([[:alnum:]|\.]*)@([[:alnum:]|\.]*)" /> 
<cfscript>
        function mask() {
                var str = arguments[1];
                var i = 1;
                var length = LEN(str);
                var returnStr = "";
                for (i=1; i LTE length; i=i+1) { 
                        returnStr = returnStr & "&###ASC(MID(str, i, 1))#";
                        }
                return returnStr;
                }
</cfscript>
<cfoutput> 
#REReplaceNoCase(str, reg, mask("[EMAIL PROTECTED]"), "ALL")#
</cfoutput>
-----------------------------------------------------------

If I just return the "str" value it returns the email address but is I loop 
over the string I get "[EMAIL PROTECTED]" returned as the string.

Is there a way around this?

Steve









--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to