in reply to Regexes on Streams

Well, this idea isn't new. It has (of course) been discussed on p5p. And was never implemented because noone could find a solution to the problems you list. What are you going to do with /.*;/, which basically asks you to find the last semi-colon in the stream?

Abigail

Replies are listed 'Best First'.
Re: Re: Regexes on Streams
by liz (Monsignor) on Oct 11, 2003 at 10:53 UTC
    What are you going to do with /.*;/,...

    When matching a stream, I would let this cause an execution error. In my mind, it's similar to division by 0. And that also causes an execution error.

    Liz

Re: Re: Regexes on Streams
by tsee (Curate) on Oct 11, 2003 at 07:19 UTC
    Nothing. Anybody asking for any *last* thing in a stream is asking for trouble! Streams are of infinite length by concept, which is something one should be aware of before trying to combine streams and regexes.

    So in brief: /.*;/ should yield the whole stream in-memory. Which is exactly what the author of the regex asked for.

    Steffen