in reply to Re: Grabing a Page and Need to Parse it..
in thread Grabing a Page and Need to Parse it..

The /o there does nothing. And you'll probably need to make it .*? instead of .* to keep from grabbing too much.

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: Re: Grabing a Page and Need to Parse it..

Replies are listed 'Best First'.
Re: Re: Re: Grabing a Page and Need to Parse it..
by AidanLee (Chaplain) on May 07, 2001 at 20:53 UTC
    also keep in mind that '.' does not match newlines. so you may be looking for [.\n]*? instead.

    update: I should have known that I was missing something. It seemed most out of character for merlyn to miss something like that.

Re: Re: Re: Grabing a Page and Need to Parse it..
by swngnmonk (Pilgrim) on May 08, 2001 at 21:05 UTC
    Ok, this is beyond the scope of the initial question, but I'm curious anyways - the /o caches the Regexp so it doesn't need to be re-compiled, correct? I'm not familiar with the innards of the interpreter, but in the event we returned to this RE, wouldn't that be an (albeit extremely minimal) optimization?