For a web app I\'m trying to come up with a javascript regex that matches anything not ending in .json. Sounds simple but I\'m finding it pretty damn hard.
.json
You can always just get the file extension and then compare it.
Regex to find file extension
/\.[^.]*$/
get the file extension with
var extension = /\.[^.]*$/.exec("something.json"); if(extension[0] === ".json"){ //do something }