javascript - Regular expression for excluding file types .exe and .js -
i using jquery file upload plugin, giving value option accept files need regular expression tells file types restricted. need restrict both exe , js achieved using below expression (\.|\/)(!exe|!js)$ but expression not allowing other files tried adding 1 extension below (\.|\/)(!exe|!js|pdf)$ with above regular expression accepting pdf , not accepting exe , js. need enable file extentions except exe , js. difficult add extensions expression. can mention how in expression accept other filetypes except exe , js in similar format above. regular expression js. thanks, vinay this exclude .js , .exe @ end of string, allow else: /^[^.]+$|\.(?!(js|exe)$)([^.]+$)/ broken down: ^[^.]+$ matches string no dots \.(?!(js|exe)$)([^.]+$) matches dot if not followed js or exe @ end of string. the following allowed: something.js.notjs somethingelse.exee /something.js/foo the following not allowed: jquery.js outlook.exe note: excluding file extens...