PDA

View Full Version : Exclude files by pattern


[Pi]
11-02-2005, 05:58 PM
I have a directory tree which contains blah_nn.html and blah_nn_1.html, where blah_nn_1.html are the "Printable" versions of blah_nn.html. Can phpDig be configured to exclude files matching /blah_\d+_1\.html/i when spidering?

Thanks,

Pi

[Pi]
11-02-2005, 06:07 PM
Hmm.

Now that I think about it, I could mess with FORBIDDEN_EXTENSIONS.


define('FORBIDDEN_EXTENSIONS','(\d+_1\.html)|\.(rm|ico|cab|swf|css|gz|z|tar |zip|tgz|msi|arj|zoo|rar|r[0-9]+|exe|bin|pkg|rpm|deb|bz2)$');


Is that reasonable?

Charter
11-02-2005, 07:11 PM
Yes, very reasonable. Try [0-9]+ though as eregi is used. See this (http://www.phpdig.net/forum/showthread.php?t=1684) thread for another example.