Using Regular Expressions with DownThemAll to exclude a file name

3

1

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.

Michael Paul

Posted 2015-01-23T19:26:14.253

Reputation: 119

Answers

2

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)$/i

Hope that helps

Muffin

Posted 2015-01-23T19:26:14.253

Reputation: 56