RE: F&O comments on 6.4

Hi,

> > - Is an error raised only if the entire pattern matches the 
> > zero-length string?  What about captured substrings, like 
> > replace("xxx", "()x*",
> > "$1") or replace("xxx", (^).*($)", "$1$2")?  Are these 
> > allowed (resulting in the empty string?) or are they errors?
> 
> I can't see any strong reason why a zero-length captured substring shouldn't
> be allowed, but perhaps I'm missing something.
> 

While zero-length captured substrings might be permissible, I beleive
these examples would result in errors being thrown because both "()x*" and
"(^).*($)" match the zero-length string.

Accordingly, valid examples for this would be replace("xxx", "()x+", "$1")
and replace("xxx", "(^).*($)", "$1$2"), both of which do not have patterns
matching the zero length string. Like the original examples, these should 
result in the empty string.

Cheers, 
Jennifer

-- 
Jennifer "Georgina" Schachter, Software Engineer   +44-1865-203192
DecisionSoft Limited                               http://www.decisionsoft.com
XML Development and Services

Received on Wednesday, 11 December 2002 07:17:09 UTC