Lookbehind Alternative Regex
//(?<!filename)\.js$
^(?:(?!filename\.js$).)*\.js$
Grieving Gharial
//(?<!filename)\.js$
^(?:(?!filename\.js$).)*\.js$