<?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>4543</bug_id>
          
          <creation_ts>2007-05-06 19:59:49 +0000</creation_ts>
          <short_desc>[FO] Multiline mode in regular expressions</short_desc>
          <delta_ts>2007-11-16 09:15:43 +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 1.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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="Michael Kay">mike</reporter>
          <assigned_to name="Ashok Malhotra">ashok.malhotra</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>15025</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-05-06 19:59:49 +0000</bug_when>
    <thetext>I previously raised this issue by email (member-only):

http://lists.w3.org/Archives/Member/w3c-xsl-query/2006Aug/0020.html
http://lists.w3.org/Archives/Member/w3c-xsl-query/2006Aug/0021.html

and the minutes of meeting 308 record the following:

http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2006Sep/0027.html

J5.1 Multiline mode in regular expressions (Michael Kay) http://lists.w3.org/Archives/Member/w3c-xsl-query/2006Aug/0020.html
see also:
http://lists.w3.org/Archives/Member/w3c-xsl-query/2006Aug/0021.html 

*Michael will open a bugzilla report and resolve it with the suggested changes.

It appears however that this was not recorded as an official action and was therefore not pursued. The problem remains in the spec. Specifically:

Consider the expression

matches($in, &apos;^.*$&apos;, &apos;m&apos;)

Intuitively, this returns true if $in contains a zero-length line. I believe
that on both Java and .NET, there is not considered to be a zero-length line
between a final newline character and the end of the string, so if $in is:

&quot;abcd&amp;#xa;defg&amp;#xa;&quot;

the expression will return false. But with our spec, I think there is a
zero-length line after the final newline, so this expression will return
true.

I think that in 7.6.1.1 Flags, under the description of flag &quot;m&quot;, we should
change 

^ matches the start of any line (that is, the start of the entire string,
and the position immediately after a newline character)

to

^ matches the start of any line (that is, the start of the entire string,
and the position immediately after a newline character other than a newline
that appears as the last character in the string)

and change:

&quot;while $ matches the end of any line (that is, the end of the entire string,
and the position immediately before a newline character)&quot; 

to

while $ matches the end of any line (that is, the position immediately
before a newline character, and the end of the entire string if there is no
newline character at the end of the string)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15117</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-05-18 10:43:20 +0000</bug_when>
    <thetext>This change was accepted at the joint meeting 330 on 2007-05-15. The change will be published as Erratum FO.E7.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>