RE: MS-FO-LC1-047: 7.5.2 fn:matches

Michael:
In response to your comment as well as others the WGs agreed to accept Michael Kay's proposal and add another mode "s" for what Perl calls single-line mode.  We also added support for back-references.  This was approved by the joint WGs on 10/01/2003.  

All the best, Ashok

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Michael Rys
> Sent: Wednesday, July 02, 2003 6:04 AM
> To: Jeni Tennison
> Cc: Kay, Michael; public-qt-comments@w3.org
> Subject: RE: MS-FO-LC1-047: 7.5.2 fn:matches
> 
> 
> I think the confusion came from using the term multi-line for the mode
> where you search in a single line and do not match a newline.
> 
> Maybe we should call it the per-line mode (vs the string mode).
> 
> Thanks and best regards
> Michael
> 
> > -----Original Message-----
> > From: Jeni Tennison [mailto:jeni@jenitennison.com]
> > Sent: Wednesday, July 02, 2003 2:05 AM
> > To: Michael Rys
> > Cc: Kay, Michael; public-qt-comments@w3.org
> > Subject: Re: MS-FO-LC1-047: 7.5.2 fn:matches
> >
> > Hi Michael,
> >
> > [regarding errors in the examples of fn:matches()]
> > > The first one is within a line, but the strings are distributed over
> > > two lines.
> > >
> > > The second one is using the multi-line option, so it should find it,
> > > but it currently returns true. Etc.
> > >
> > > Either the examples are wrong or the description of multiline
> > > matching is confusing.
> >
> > The behaviour for the particular examples is described in 7.5.1
> > Regular Expression Syntax, where it says:
> >
> >   * In string mode, the metacharacter . matches any character
> >     whatsoever. In multiline mode, the metacharacter . matches any
> >     character except a newline (#x0A) character.
> >
> > The first example:
> >
> >   fn:matches(., "Kaum.*krähen")
> >
> > is in string mode, so the metacharacter . matches any character
> > whatsoever, including newline (#x0A) characters. Thus it will return
> > true despite the fact that "Kaum" and "krähen" appear on different
> > lines, because the . can match the newline character between them.
> >
> > The second example:
> >
> >   fn:matches(., "Kaum.*krähen", 'm')
> >
> > is in multiline mode, so the metacharacter . matches any character
> > aside from newline (#x0A) characters. Thus it will return false
> > because "Kaum" and "krähen" have a newline character (which can't be
> > matched by the .) between them.
> >
> > Personally, I think that the spec is clear, but perhaps you have some
> > suggested wording that would make it clearer?
> >
> > Cheers,
> >
> > Jeni
> >
> > ---
> > Jeni Tennison
> > http://www.jenitennison.com/
> >
> 
> 

Received on Monday, 6 October 2003 08:32:50 UTC