What I am trying to do is remove the set of characters from the message ID header and save that to a string. However, I am getting the compile error “Character is not valid”.
This is so I can use the Message-ID as a unique filename that I can recalculate accurately on demand later in my process. This is because I need to upload the saved mail message.
I don’t actually know is / and \ appear in message IDs ever to be fair (maybe someone can tell me?), so might not need to replace them at all. However, I get the same error with 1 character in the replacement string.
In order to avoid "." acting as a quantifier in a pattern, "\" is an escape character used to consider "." as a literal. Inside [ ] , '.' normally acts as a literal. but i used "\" just force it to consider as literal .
Inside the activity, "" acts as an escape character to consider " as a literal.
mail.Headers(“Message-ID”) is already in string format.
Please make sure you are getting value for “Message-ID”. You can use a writeline activitymail.Headers(“Message-ID”) before doing the regex operation to verify it.