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
Try /^(?!.*\.json$).*$/
/^(?!.*\.json$).*$/
/^(?!.*\.json$).*$/.test("foo.json") false /^(?!.*\.json$).*$/.test("foo") true /^(?!.*\.json$).*$/.test("foo.html") true