I am looking for a Regex that allows me to validate json.
I am very new to Regex\'s and i know enough that parsing with Regex is bad but can it be used to validate?
I realize that this is from over 6 years ago. However, I think there is a solution that nobody here has mentioned that is way easier than regexing
function isAJSON(string) { try { JSON.parse(string) } catch(e) { if(e instanceof SyntaxError) return false; }; return true; }