Using Regular Expressions with DownThemAll to exclude a file name
I'm using DownThemAll and a bit of regex to grab files from a web page.
My DownThemAll filter is set up as follows: /\.(?:pdf|doc|docx|xls|xlsx|ppt|zip)$/i
However, each page also includes the file WBSDictionary.xls, which I'd like to exclude.
I've tried /(?!WBSDictionary)\.(?:pdf|doc|docx|xls|xlsx|ppt|zip)$/i to no avail. Am I doing it wrong, or does DTA's implementation of regex simply not support this?
I'm pretty new to regex.
1 Answer
Try this include files with extensions pdf|doc|docx|xls|xlsx|ppt|zip while excluding the file WBSDictionary.xls
/^(?!.*WBSDictionary\.xls$).*\.(pdf|doc|docx|xls|xlsx|ppt|zip)$/iHope that helps