W3C home > Mailing lists > Public > public-qt-comments@w3.org > June 2007

[Bug 4634] [FO] poorly formed back-references

From: <bugzilla@wiggum.w3.org>
Date: Tue, 12 Jun 2007 20:10:22 +0000
To: public-qt-comments@w3.org
Message-Id: <E1HyCh4-0005Me-NN@wiggum.w3.org>


           Summary: [FO] poorly formed back-references
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: andrew.eisenberg@us.ibm.com
         QAContact: public-qt-comments@w3.org

In section 7.6.1, Regular Expression Syntax, we say:

"Back-references are allowed. ... A back-reference matches the string that was
matched by the nth capturing subexpression within the regular expression, that
is, the parenthesized subexpression whose opening left parenthesis is the nth
unescaped left parenthesis within the regular expression. The closing right
parenthesis of this subexpression must occur before the back-reference. ..."

In Bug #4610 we considered the following query:

replace("abcd", "(a)\2(b)", "")

While I interpreted the violation of "must occur" as requiring that an error be
raised, Michael Kay interpreted it as causing the back-reference to fail to
match a string.

The replace function acknowledges that a pattern can be invalid, saying:

"An error is raised [err:FORX0002] if the value of $pattern is invalid
according to the rules described in section 7.6.1 Regular Expression Syntax."

Let me suggest that this be clarified by changing the existing sentence: 

"The closing right parenthesis of this subexpression must occur before the

to the following:

"The regular expression is invalid if the closing right parenthesis of this
subexpression occurs before the back-reference."
Received on Tuesday, 12 June 2007 20:10:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:33 UTC