Say i have a string like so
Shoes {cakes} marry me {fiona:banana|cheese} and then {i want}
I want to get an array like so
["Shoes", " marry me ", " and then "]
or even
["Shoes", " marry me ", " and then ", ""]
I know that if i have a single char, e.g.
Shoes {a} marry me {b} and then {c}
I can do
"Shoes {a} marry me {b} and then {c}".split(/\{.\}/) to get my result.
I tried
"Shoes {cakes} marry me {fiona:banana|cheese} and then {i want}".split(/\{(.*)\}/)
But my result looks like
["Shoes ", "cakes} marry me {fiona:banana|cheese} and then {i want", ""]
.split(/{.*?}/).