W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2015

[Bug 29253] [XQ3TS] fn-matches-50

From: <bugzilla@jessica.w3.org>
Date: Wed, 04 Nov 2015 11:25:40 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29253-523-aAlic6yC3v@http.www.w3.org/Bugs/Public/>

--- Comment #5 from Tim Mills <tim@cbcl.co.uk> ---
(In reply to Michael Kay from comment #3)
> Surely (.?) can be bound to an empty string, but (.)? can't? I would have
> thought a group should never be bound to a string that doesn't match the
> regex fragment inside the parentheses.

The specification says

"If no string is matched by the Nth capturing subexpression, the back-reference
is interpreted as matching a zero-length string."

So (.?) would match an empty string, and bind the \1 to the empty string.

But (.)? can match the empty string, but no string is matched by thecapturing
subexpression, yet the back-reference \1 is still bound to the empty string.

You are receiving this mail because:
You are the QA Contact for the bug.
Received on Wednesday, 4 November 2015 11:25:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 4 November 2015 11:25:44 UTC