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:
{code:java}
<cfscript>
function escapeSpecialCharsA(required string term) {
return reReplace(term, '(\[|\])', '\\\1', 'all');
}
function escapeSpecialCharsB(required string term) {
return reReplace(term, '([\[\]])', '\\\1', 'all');
}
function test(actual,expected) {
writeDump({
expected: expected,
got: actual
});
}
test(escapeSpecialCharsA("[]"), "\\[\\]");
test(escapeSpecialCharsB("[]"), "\\[\\]");
</cfscript>
{code}
Steps to Reproduce:
See above
Actual Result:
\[\]
Expected Result:
\\[\\]
Any Workarounds:
Works in Lucee!
Attachments:
Comments: