<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29817</bug_id>
          
          <creation_ts>2016-09-12 12:49:07 +0000</creation_ts>
          <short_desc>Typo in reluctant qualifiers example</short_desc>
          <delta_ts>2016-12-16 19:55:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joe Wicentowski">joewiz</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>127367</commentid>
    <comment_count>0</comment_count>
    <who name="Joe Wicentowski">joewiz</who>
    <bug_when>2016-09-12 12:49:07 +0000</bug_when>
    <thetext>At https://www.w3.org/TR/xpath-functions-31/#regex-syntax, one of the examples of reluctant qualifiers contains a typo, I believe:

&gt; X?? matches X, once or not at all

The 2nd question mark is extraneous, since the following evaluate as true:

&gt; matches(&quot;X&quot;, &quot;X?&quot;)
&gt; matches(&quot;&quot;, &quot;X?&quot;)

Thus the 2nd question mark can be removed, as follows:

&gt; X? matches X, once or not at all

The identical example is also present in earlier versions, https://www.w3.org/TR/xpath-functions/#regex-syntax and https://www.w3.org/TR/xpath-functions-30/#regex-syntax.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127368</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-12 13:34:51 +0000</bug_when>
    <thetext>The example is correct.

X?? does matches X occurring zero or one times, just as X? does. The difference between the two, as explained in the text below the example, as that X? matches the longest possible substring, while X?? matches the shortest possible.

For example, the result of

replace(&quot;AAA&quot;, &quot;(A?)(A+)&quot;, &quot;1=$1 2=$2&quot;)

is &quot;1=A 2=AA&quot;

while the result of 

replace(&quot;AAA&quot;, &quot;(A??)(A+)&quot;, &quot;1=$1 2=$2&quot;)

is &quot;1= 2=AAA&quot;

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127369</commentid>
    <comment_count>2</comment_count>
    <who name="Joe Wicentowski">joewiz</who>
    <bug_when>2016-09-12 13:44:38 +0000</bug_when>
    <thetext>Thank you, now I understand! 

(I had tried to raise this as a question in xquery-talk first, but the list has been down since some time this summer. The maintainers of the list have been notified and are working on restoring service.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>