Here is a regex that works fine in most regex implementations:
(?
This matches .js for a string which ends with .js exc
This is an equivalent solution to Tim Pietzcker's answer (see also comments of same answer):
^(?!.*filename\.js$).*\.js$
It means, match *.js except *filename.js.
To get to this solution, you can check which patterns the negative lookbehind excludes, and then exclude exactly these patterns with a negative lookahead.