Match regex between curly braces
I need to match with regular expression the tokens from text:
Hello {FullName}, I wanted to inform that your product {ProductName} is
ready.
Please come to our address {Address} to get it!
How can I match the specific tokens in my text and fill the values using
regex?
Also I need to do it in a safe way and avoid every possible issues where
the tokens my by misspelled or have something wrong, like bellow:
**Hello {Full{Name}, I { wanted to inform that your product {{ProductName}
is ready.
Please come to our } address {Addr{Street}ess} to get it!**
P.S.
I tried this: {([^}]+)}
But if I have for example :
{FullName}
it works, but it also work if I have
{Full{Name} ...
No comments:
Post a Comment