Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#559 In regex, \'x\' flag enables comments

v8.7.3
closed
Michael Kay
5
2012-10-08
2006-07-04
Michael Kay
No

Unlike Perl and Java, the 'x' flag in XPath regular
expressions is not defined to enable comments in the
regular expression. (The reason for this is that Perl
regex comments run from '#' to the end of the line, and
because of attribute value normalization, the concept
of end-of-line is not meaningful within XPath
expressions written within an XML attribute, for
example in XSLT.)

Saxon's implementation, however, maps the 'x' flag in
XPath to the 'x' flag in the underlying Java or .NET
regular expression, which means that it incorrectly
enables comments. This affects a regular expression
that is using '#' as an ordinary character.

Discussion