Project

Profile

Help

Bug #3833

closed

Problems using fn:replace() with special characters in replacement string

Added by Debbie Lockett over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2018-07-04
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Bug discovered while working on Issue #3790.

Attempted to convert a supplied string to a regex string (e.g. suitable for use in xsl:analyze-string) by escaping characters explicitly:


fn:replace($search, "[\^\.\\\?\*\+\{\}\(\)\|\$\[\]]", "\\$0" )

However this did not work as expected. Apparently there is some problem handling special characters in the replacement string (the 3rd arg of fn:replace) in the Saxon-JS implementation.


Related issues

Related to SaxonJS - Bug #3910: Error using fn:replace() with "q" flag when search string contains "-" characterClosedDebbie Lockett2018-09-19

Actions

Please register to edit this issue

Also available in: Atom PDF Tracking page