Leo,
oops..
I had copied that incorrectly from a much larger regex which contained (\s+\P{Ll}{3,280}?) and was giving an exception.
Actually I just noticed that the exception I was getting prior to copying was
[FORX0004] Regular expression: 'Illegal quantifier, lower > upper bound: {3,2}'
related to {3,280} if I change it to {3,80} the exception goes away
Thanks
Alex
.
Hi Alex,
Am 25.09.2012 15:45, schrieb Alex Muir:
> let $regex := 'P{Ll}'I think you missed a backslash, the category escape matching
>
> let $input := .//subsection[matches(@title,$regex)]
>
> causes the error [FORX0004] Regular expression: 'Lexical error at line
> 1, column 3. Encountered: "L" (76), after : "{"'.
non-lowercase characters is '\P{Ll}'. Without the backslash, the braces
are interpreted as a quantifier [1], which expects a number instead of "L".
> <http://www.w3.org/TR/xpath-functions-30/#ERRFORX0004>] if the value of
> I looked in the xquery spec for the error and found which seems to be
> something else
> An error is raised [err:FORX0004
> |$replacement| contains a "|$|" character that is not immediatelyYou are correct, the wrong error code is used. It should be FORX0002
> followed by a digit |0-9| and not immediately preceded by a "\".
(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