in reply to How to move unwanted lines out of a file

Fletch is right: there's really no way to diagnose the problem if you don't indicate what sorts of lines are matching when they shouldn't. Maybe if you do that, you'll see the problem yourself.

As a wild guess, given that your regex comes out looking like this:

/00000|00001|00002|.../
and given that your logic says "don't print a line if it matches that regex", the first thing that comes to mind is that your 52 lines might include lines like this:
...100000.... any five zeros in a row will match ...4850001... any four zeros followed by 1 will match.
You might think that a number like "100000" shouldn't match, but it will, because the strings in the regex are not anchored in any way. If this is the problem, the solution is easy:
my $finds_re = '\b' . join( '|', map { quotemeta } @finds ) . '\b';
(or something like that).

Replies are listed 'Best First'.
Re: Re: How to move unwanted lines out of a file
by skyler (Beadle) on Mar 23, 2004 at 20:06 UTC
    I think that you are right. The regex was not anchored....