I have this following problem. i try to split a string up depending on a regex.
I want to to split it by {{ name }}, {{ age }} and so on.
The expected output should look like this:
["hy my name is: ", "{{ name }}", " and i am ", "{{ age }}", " old"]
My current attempt was this here:
let str = "hy my name is: {{ name }} and i am {{ age }} old";
let vars = str.split(/({{)(.*)(}})/);
console.log(vars);
Whats the correct regex for this task?