re: the changing values: bleh. Yeah, thats what i get for being lazy.
re: the unexpected results, ah, okay, i missed that caveat.
PHP Code:
$filenames = array_map('trim',file('WP_ro_files.txt',FILE_IGNORE_NEW_LINES| FILE_SKIP_EMPTY_LINES));
$files = array('~403\.php~','~404\.php~','~406\.php~','~414\.php~','~500\.php~','~501\.php~','~favicon\.ico~','~\.htaccess~','~robots\.txt~','~^(/?[^/]+)/plugins~','~^(/?[^/]+)/themes~');
$filesrep = array('403.php','404.php','406.php','414.php','500.php','501.php','favicon.ico','.htaccess','robots.txt','$1/plugins','$1/themes');
$todelete = array_diff($filenames,preg_filter($files,$filesrep,$filenames));
var_dump($todelete);
Bookmarks