JSFiddle - React, Tailwind, and code Playground

by ppgab

JavaScript

text = '${1} string asdi${2}${3} __pasdo3931 fasd $ $ { } }} ${4}'


text.replace(/\${([^}{]+)}/g, (match, fieldname) => console.log(match, field))