I have this regexp and substitution patterns demo and need to use it within an xpath context with the fn:replace function,but I can't figure out how to write the replacement string correctly Is it possible ? my naive test was
replace ("dsfjkljsdfjlsjdfABCDdfsfsdff",
"(\p{Lu})(\p{Lu}+)",
"$1\L$2")
but it complains with FORX0004 : Invalid replacement string in replace() : \ character must be followed by \ or $
xsl:analyze-stringto "implement" anything with regular expressions the XPath 2replacemight not give you, so if you want to apply a string function to the part of the match I think you should look at that option. - Martin Honnen