This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In bug #4543 we decided that in multiline mode, a trailing newline should be disregarded when considering whether we are at the end of the string for the purpose of matching '$'. However, there was no suggestion that a trailing newline should be disregarded when not in multiline mode. However, it appears that some popular regex engines do interpret '$' in this way. As evidence, the XSLT 2.0 test case regex02 expects '$' to match in these circumstances, and in several years the test case has not been challenged. A new test case has been added to QT3 to help resolve the question. fn-matches-47 does this query fn:matches(concat('abcd', codepoints-to-string(10), 'defg', codepoints-to-string(10)), "g$") and the answer is clearly false given the spec as currently written. It is reported in email that XmlPrime returns false, while DB2 LUW 9.7 returns true. Saxon 9.4 also returns true, but the current development build of Saxon, with a new regex engine, returns false: that's how the problem came to my attention. We need to decide whether to confirm the current specification or to be "bug-compatible" with existing implementations. If we do decide to be "bug-compatible" we need to decide exactly what characters at the end of the string should be ignored.
Mary Holstege reports on email that: MarkLogic returns false.
Decided to keep the spec as it is.