in reply to Matching against a partially known string

You might find Applying regexes to streams: Perl enhancement idea informative.

                - tye
  • Comment on Re: Matching against a partially known string (link)

Replies are listed 'Best First'.
Re: Re: Matching against a partially known string (link)
by wonkozen (Initiate) on Sep 19, 2003 at 21:30 UTC

    Yes, the /z modifier would precisely fit what I'm looking for.

    Let me clarify my problem by contrasting it with your sample code:

    • The stream should consist exclusively of a sequence of matchable texts. That is, $` should always be ''. (Remember the ^ at the beginning of my $pattern.)
    • I want to know as soon as possible that a pattern won't be able to match the buffer. It's somewhat easier for me because I know that my pattern begins with ^.

    Dare I open up the perl source code and try to implement this now?

      I poked around in regexec.c. Whoa, heavy magic! Maybe --just maybe-- if the perl RE engine weren't so optimized, I would have the confidence to change stuff and implement /z. But not on the existing RE engine.

      I'm now considering using Sandfly's suggested technique with YAPE::Regexp to provide the list of atoms.

      Thanks to all for the useful comments and suggetions.