http://qs321.pair.com?node_id=311664


in reply to Re: a word of warning about /$pattern/
in thread a word of warning about /$pattern/

To my limited understanding, it seems like an empty pattern will return true.

that's not true (or not accurate, at least). read carefully the italic lines in my previous message, in particular: if no match has previously succeded, this will (silently) act instead as a genuine empty pattern (which will always match).

If all patterns are empty, is the whole expression true? Did you test with all of the patterns being empty?

yes, and yes. and that was even worse, because it helped to hide the bug from my eyes. when all the patterns were empty, all the records did match. but this happened only because no match has previously succeded, so this is something subject to an action-at-a-distance (eg. a succesful pattern match 1000 lines before may very well alter the behaviour of the search).

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

  • Comment on Re: Re: a word of warning about /$pattern/

Replies are listed 'Best First'.
Re: Re: Re: a word of warning about /$pattern/
by Theo (Priest) on Dec 02, 2003 at 17:17 UTC
    (eg. a succesful pattern match 1000 lines before may very well alter the behaviour of the search)

    That's horrible! I'm sure I'll be hit with that one sooner or later. (Hope I remember this fact at that time).

    -theo-
    (so many nodes and so little time ... )