My regex is pretty weak so I need some help. I have a case where I need to find all individual words between curly braces. I need a single regex to do the below use case. I cant post process the regex.
For example
Hi {{username}}, You total is {{ user.total - discount}}, please pay by date {{moment.utc(userPaymentDateTime)}}
The output here should be like
[username, user.total, - , discount, moment.utc,userPaymentDateTime]
I've Tried the following
\{{(.*?)\}}
Output is [username,user.total-discount,moment.utc(userPaymentDateTime)]
(?!{{)\s*(\w+)\s*(?=}})
Output is [username, discount]