-1

I have a pretty simple piece of regex code: (\{)[^}]+(\}) , which only gets the first set of ({)[^}]+(}). Is there a way to get all sets of brackets?

MatthewProSkils
  • 364
  • 2
  • 13

1 Answers1

0

just add the global flag g

let regexp = /(\{)[^}]+(\})/g;
sonEtLumiere
  • 4,461
  • 3
  • 8
  • 35