tracker issue : CF-4203087

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

ReReplace - Can't escape special chars in backreference

| View in Tracker

Status/Resolution/Reason: To Fix//NeedMoreInfo

Reporter/Name(from Bugbase): John Whish / ()

Created: 07/17/2018

Components: Language, Functions

Versions: 2016,2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: ACF2018 /

Priority/Frequency: Normal / Few users will encounter

Locale/System: / Platforms All

Vote Count: 0

Problem Description:
function escapeSpecialCharsA(required string term) {
	return reReplace(term, '(\[|\])', '\\\1', 'all');
function escapeSpecialCharsB(required string term) {
	return reReplace(term, '([\[\]])', '\\\1', 'all');

function test(actual,expected) {
        expected: expected, 
        got: actual
test(escapeSpecialCharsA("[]"), "\\[\\]");
test(escapeSpecialCharsB("[]"), "\\[\\]");

Steps to Reproduce:
See above

Actual Result:

Expected Result:

Any Workarounds:

Works in Lucee!



I see this is flagged as "NeedMoreInfo" - what more info do you need? Have you run the example?
Comment by John W.
32067 | January 28, 2020 02:19:06 PM GMT