Updated regex to fix matching trailling } by '} for json string fix