Hi Alex,
Am 25.09.2012 15:45, schrieb Alex Muir:
let $regex := 'P{Ll}'
let $input := .//subsection[matches(@title,$regex)]
causes the error [FORX0004] Regular expression: 'Lexical error at line 1, column 3. Encountered: "L" (76), after : "{"'.
I think you missed a backslash, the category escape matching non-lowercase characters is '\P{Ll}'. Without the backslash, the braces are interpreted as a quantifier [1], which expects a number instead of "L".
I looked in the xquery spec for the error and found which seems to be something else An error is raised [err:FORX0004 http://www.w3.org/TR/xpath-functions-30/#ERRFORX0004] if the value of |$replacement| contains a "|$|" character that is not immediately followed by a digit |0-9| and not immediately preceded by a "".
You are correct, the wrong error code is used. It should be FORX0002 (invalid regular expression, [2]) instead. I'll fix that soon.
Cheers, Leo
[1] http://www.w3.org/TR/xmlschema11-2/#nt-quantifier [2] http://www.w3.org/TR/xpath-functions-30/#ERRFORX0002