I have email template that look like that:
Dear {user.firstName},<br><br> Thank you for buying {item} with us. <br><br>
Your Order ID is : <b> {{orderId}} </b>. <br><br>
Thank again for supporting us.
Below is the example of what i trying to extract from the paragraph:
1) The thing inside {} from a paragraph
user.firstName // from {user.firstName}
item // from {item}
orderId // from {{orderId}}
2) Entire {} including the thing inside from a paragraph
{user.firstName} // from {user.firstName}
{item} // from {item}
{orderId} // from {{orderId}}
For (1), I tried with /{(.*)}/g
or /({)(.*)(})/g
but it will still select entire {{tag}}.
Below is what i have tried for (2):
/({([a-z])\w+})|({([a-z])+})|({([A-Z])\w+})|({([A-Z])+})|({[0-9]+})/g
It can cater most of criteria, except if there is a/multiple dot in the {tag}.
Please help and thank you in advance.