0

I'm using regex to replace some text inside my code like this :

text.replace(
    /\{\#(variable)\#\}/g,
    this.options.vars[i].companyName,
);

I want to use a variable inside the pattern because I have a string like this lorem ipsum {#variable1#} dolor {#variable2#}, but I can't find a way to pass a variable inside the pattern.

0 Answers0