Classification: Public “+” is a special character for regular expressions. The 2nd parameter to fn:replace is treated as a pattern, not just a plain string.
Try “\+” instead. Cheers, Tony. From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of Kapoor, Pragya Sent: 11 March 2015 09:26 To: MarkLogic Developer Discussion Subject: [MarkLogic Dev General] fn:replace Query Hi, I am running the below query fn:replace(fn:concat('test','-',fn:current-dateTime()),'+','@') This query is giving the following error: [1.0-ml] XDMP-REGEX: (err:FORX0002) fn:replace("test-2015-03-11T14:46:58.44+05:30", "+", "@") -- Invalid regular expression Please let me know, why ML is behaving this way. Thanks Pragya "This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful." --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for information about privacy.
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general