Jeff 'Japhy' Pinyan wrote at Tue, 01 Jul 2003 12:39:37 -0400: > On Jul 1, [EMAIL PROTECTED] said: > >>\.[^(gz|html)]$ >> >>this regex should match all files (lines) NOT ending with gz or html. > > or else use a negative look-ahead: > > if ($filename =~ /\.(?!gz|html)[^.]*$/) { > # (?!...) means "is not followed by" > }
That regexp does not match only for files ending on .gz or .html, but also for files ending on .gzsz or .htmlx or similar. I would prefer to write it as /\.(?!gz$|html$)/ or /\.(?!(gz|html)$)/ Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]