Is there a way to replicate this PHP snippet in JQuery or Javascript...
This expression should work fine:
/{([^}]+)}/g