> Ian Jackson writes ("RE: RegexString: was it really meant to 
> be that way ?"):
> > I've just tried my version of RegexString with a compiler snapshot
> > obtained by using  cvs up -D '25 December 1999'  and it doesn't work
> > properly any more.  It seems that re_match now gives a REmatch whose
> > first field, Array Int GroupBounds, is always indexed from 0 to some
> > moderately large number, rather than only having the `relevant'
> > elements in it.
> > 
> > I shall work around this in my program by matching against 
> a:b:_ &c  as
> > you suggest, but it does defeat part of the purpose of my patch.
> 
> Oh, and substrPS now fails if the supplied bounds are outside the
> string, even if the end is before the beginning.  This is a bit
> unhelpful, but either way the behaviour should be documented.

I don't think the behaviour of substrPS has changed, but you're right it
does fail if end < start, or start < 0.  Interestingly, it yields the empty
string if end is past the end of the string.

Would anyone object to removing the failure case, so that substrPS gives the
empty string if either:

        - start < 0
        - end > len
        - end < start

?

Cheers,
        Simon

Reply via email to