I have the following string and object,
const str = "$(role.name) is $(role) team. $(role.name) started his role as $(role)"
const obj = {
role: 'Dev',
'role.name': 'Foo',
}
const expected = "Foo is Dev team.Foo started his role as Dev"
How to using regex ?
My regex ,
const data = str.match(/\$\((.*?)\)/g)