Reputation: 77
I'm trying to match a substring using regex.
An example of the substring I've got is:
"{{simple-array.text}}{{simple-array.option}}"
.
Using the following pattern: {(.*?)}
, I get the following two matches: {{simple-array.text}
and {{simple-array.option}
.
I'm not sure how to get the following output using regex:
{simple-array.text}
and {simple-array.option}
.
Upvotes: 0
Views: 174
Reputation: 675
Very close!
Regex Pattern: {({.*?})}
Returns:
{simple-array.text}
and {simple-array.option}
within group 1
Upvotes: 2