fixed the weird regex issue when parsing multiple curly brackets