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 <[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