I have an edm template input/generated by a web frontend, and I have to replace all merge tags in the format *|TAG_NAME|* with its corresponding value.
I tried to use the below RegEx but it seems I got an error on the | characters.
^\*|[0-9A-Za-z]+|\*$
Below is a sample template (in json format):
"fields": [
{
"key": "member_id",
"label": "Member ID",
"value": "*|member_id|*"
}
Any help is appreciated!
| is a special regex metacharacter (means OR), therefore you have to escape it with \
^\*\|[0-9A-Za-z]+\|\*$