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 Wednesday, 2 July 2003 09:04:50 UTC