yeah but i need to only replace the email address our of a string so the string would be fore example "my name is steve and my email address is [EMAIL PROTECTED] so if you want to email me go for it" I need to be able to extract the email address which is what the regular expression does. The email address could be anything so i want to be able to pass the back references from the regular expression into another function and be able to pass that back into the REReplace so i dont have to loop over the string looking for email addresses. Keep in mind that the string would be an entire HTML page. Make sense?
_____ From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Blair McKenzie Sent: Thursday, 23 August 2007 12:14 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: Evaluating regular expression back references You may be over thinking the problem. Replace already takes the whole string. For that matter REReplace also takes the whole string and only replaces the match - you could use rereplace('[EMAIL PROTECTED]@als,'@','&123','ALL') and it would still return the entire string. And I'm pretty sure replacelist replaces every occurrance. You just have to watch out for recursive replacements. Blair On 8/23/07, Steve Onnis <[EMAIL PROTECTED]> wrote: 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]"> <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 -~----------~----~----~----~------~----~------~--~---