improved regexp to replace script and css files