Here is a regex that works fine in most regex implementations:
(?
This matches .js for a string which ends with .js exc
^(?!filename).+\.js works for me
tested against:
A proper explanation for this regex can be found at Regular expression to match string not containing a word?
Look ahead is available since version 1.5 of javascript and is supported by all major browsers
Updated to match filename2.js and 2filename.js but not filename.js
(^(?!filename\.js$).).+\.js