tracker issue : CF-4070120

select a category, or use search below
(searches all categories and all time range)
Title:

CFML Reference / REReplace

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): Mauricio Saraiva / Mauricio Saraiva (Mauricio Saraiva)

Created: 10/07/2015

Components: Language, Functions

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Critical / All users will encounter

Locale/System: Portuguese / Win 2008 Server

Vote Count: 0

Problem Description: REReplace error with "." at substring param

Steps to Reproduce: <cfoutput>#REReplace("8.688.830.7", ".", "", "ALL")#</cfoutput>

Actual Result: <empty> 

Expected Result: 86888307

Any Workarounds: ColdFusion Server Enterprise 11,0,05,293506

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4070120

External Customer Info:
External Company:  
External Customer Name: Mauricio Saraiva
External Customer Email:  
External Test Config: My Hardware and Environment details: Not necessary

Attachments:

Comments:

Not necessary
Comment by External U.
5643 | October 07, 2015 08:24:44 AM GMT
Mauricio, REReplace method expects a regular expression in the second parameter. A period (".") in regex matches any character. (refer http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ffb.html). The output therefore is an expected blank string. If the purpose is to replace a char with a char at face value, you can either use REReplace's simpler cousin Replace or escape the period with a slash thus: REReplace("8.688.830.7", "\.", "", "ALL") Would that work to solve your purpose?
Comment by Piyush K.
5644 | October 08, 2015 12:44:34 AM GMT
Ok, "\." solves the problem. Thank you!
Comment by External U.
5645 | October 08, 2015 07:19:28 AM GMT
Hi Mauricio and Piyush, Just noting reEscape() would also work: <cfoutput>#REReplace("8.688.830.7", reEscape("."), "", "ALL")#</cfoutput> Many ways to choose from :) Thanks!, -Aaron
Comment by External U.
5646 | October 09, 2015 09:59:38 PM GMT