0

String ${provider.name} - ${item.publication_time|date|relative} Regex /\${([^}]+)}/gmi

From string.match(/\${([^}]+)}/gmi) this, I am getting ["${provider.name}", "${item.publication_time|date|relative}"] as output.

But I need other unmatched parts of the string in the output array. My expected result should be ["${provider.name}", " - ", "${item.publication_time|date|relative}"]

Can you please suggest me how can I achieve this by changing the regex?

0 Answers0