Regex To Get All Contents Within Curly Brackets

Let us say your string contains this data

While regex can slow down performance, I decided to use it for this situation because I can do it using only a regex pattern. This regex will get all instances of a substring between two curly brackets { and }. In the example above, the result should be 3 entries since there are 3 sets of curly brackets. Please see the regular expression below.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *