Can XQuery regex match a null character?
I'd like to remove all NULL characters from the string. I know that the right regex match should be \x00 and I've tried the following XQuery: replace($message, '\x00', '') It results in the error: exerr:ERROR Conversion from XPath2 to Java regular expression syntax failed: Error at character 1 in regular expression \x00: invalid escape sequence Is there any quick solution or workaround for this issue? I use eXist-db 2.2. Jens Erat The short version: you can't, at least not within the boundaries of the XQuery and XML specifications. There may be an eXist-DB-proprietary method I am not aware of