[Bug 29415] New: [FO31] Regex: capturing parentheses inside non-capturing parentheses

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29415

            Bug ID: 29415
           Summary: [FO31] Regex: capturing parentheses inside
                    non-capturing parentheses
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: abel.braaksma@xs4all.nl
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

I had some trouble finding out what fn:replace("abcd", "a(?:b(c))", "$1") was
supposed to return because of the normal parens nested withing non-capturing
parens. I.e., is it returning "cd" or "d"?

According to the spec, the correct answer is "cd", which probably makes sense
(though an argument against it is: if you are *inside* non-capturing
parentheses, you are not capturing anymore, so capturing parentheses here do
not capture).

While I don't think the spec is wrong here (assuming my interpretation is
correct), I would like to ask the WG to consider a line of clarification here.

Proposal, in 5.6.1 Regular expression syntax, 3rd bullet, add a Note along
those lines:

   "If parenthesized sub-expression are encountered nested withing
non-capturing 
   parentheses, these will act as capturing parentheses and numbering continues 
   as explained in the paragraphs above."

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 1 February 2016 18:38:41 UTC