I have to parse string in C# as:
Some text [ first_name | User ] some other text. [ Your birthday is on yy/mm/dd | ]
Example:
Dear [ first_name | User ], How are you?. [ Your birthday is on yy/mm/dd | ]
So, I check for brackets [] in whole text, remove space before and after characters: [, |, ] and fill the first_name from database and if first_name is not available then replace with alternative text which is User in this case.
And if there is no birthday present in database then replace Your birthday is on yy/mm/dd with null.
I know regex is for string matching, but how do I do string replacement like: Replace("first_name", Name); in regex?
Is there a third party librabry for this?