RE: tokenize/replace clarifications

> Hi, 
> 
> I am currently implementing some of the regex functionality 
> and wanted to 
> clarify the following:
> 
> Replace
> =======
> 
> - replace("foobar", "foo", "$1bar") -> The $1 is not defined in the 
>   pattern so should an exception be thrown?
> 
> - The spec says: "A literal $ symbol must be written as \$." 
>   If there is a literal that is not escaped, and it is followed by 
>   something which is not a number, should an exception be thrown?
> 
> Tokenize 
> ======== 
> - tokenize("foobar", "") -> If you call tokenize with a
>   pattern matching the zero-length string, what should the result be? 
>   I would think that an exception should be thrown (like in Replace)

Thanks for these comments, my recommendation is that we should register them
as issues and put these on the task force agenda, preferably adopting
solutions analagous to those in languages such as Perl and Java.

> 
> Also, the layout of the poem in the matches function 
> test-cases [section 6.4.16.3] has not been corrected in the 
> new release of the spec (as discussed in the email thread 
> "Regular Expressions in XQuery/XPath2" on October 21.)
> 

Thanks, yes, we noticed that this was still wrong shortly before
publication, but weren't able to get the stylesheet problem fixed in time.

Michael Kay

Received on Wednesday, 20 November 2002 10:46:00 UTC