Sep 09 2023 05:02 PM
Hello,
I'm trying to auto-apply a sensitivity label to Exchange content (a specific user mailbox) where the rule is defined by a "subject matches patterns" condition. Microsoft requires a regular expression here. The emails I'm trying to apply the label to all have the words "Litigation Hold" in the subject line. I've tried to capture these using the following regular expressions but none have worked: (?:Litigation Hold), \bLitigation Hold\b, \sLitigation Hold\s, ^(?:Litigation Hold)$, Litigation Hold. What syntax is Microsoft looking for here? Any help or examples would be appreciated, thank you.
Sep 13 2023 06:19 AM
Solution
I'm sorry it took so long for you to get a response here but I believe, after some testing, that this is the regex you'd want to use, which will establish the word boundary as you were already trying to do, but you still need to use the "?:" to set the non-capture sub-pattern.
\b(?:Litigation Hold)\b
If you go to regex101: build, test, and debug regex and choose .NET (C#) as the flavor and get a match, then it will match within Microsoft.
Oct 03 2023 10:14 AM
@miller34mike Thank you! Have you had any luck using the "Header matches patterns" condition? No matter what I try, I can't get that one to work. Any tips would be greatly appreciated.
Oct 05 2023 03:15 AM
Unfortunately, I have not used or tested that condition in the past. If you'd like to send me a specific example through a direct message on here I'll happily circulate it with others to see if we can find the resolution.
Sep 13 2023 06:19 AM
Solution
I'm sorry it took so long for you to get a response here but I believe, after some testing, that this is the regex you'd want to use, which will establish the word boundary as you were already trying to do, but you still need to use the "?:" to set the non-capture sub-pattern.
\b(?:Litigation Hold)\b
If you go to regex101: build, test, and debug regex and choose .NET (C#) as the flavor and get a match, then it will match within Microsoft.