I am trying to use XQuery with fn:matches with a regex, but MarkLogic's XQuery implementation does not seem to allow for hexadecimal characters. Following is the error < Invalid regular expression .
(: Find text containing non-ISO-Latin characters :) let $regex := '[^\x00-\xFF]' let $results := fn:collection('mydocs')//myns:myelem[fn:matches(., $regex)] let $count := fn:count($results) return <figures count="{$count}"> { $results } </figures>
However, this does not give an error.
let $regex := '[^a-zA-Z0-9]' let $results := fn:collection('mydocs')//myns:myelem[fn:matches(., $regex)] let $count := fn:count($results) return <figures count="{$count}"> { $results } </figures>
Is there a way to use hexadecimal representation or an alternative that will give me the same result in the implementation of MarkLogic XQuery?
source share