简体   繁体   English

在线交流女士 | 传输规则中的正则表达式

[英]Ms Exchange Online | Regex in Transport Rule

I want to create a Regex Transport rule for the email with Subject 1365 1049126 9003175245 19382_ST03我想为主题为1365 1049126 9003175245 19382_ST03的 email 创建一个正则表达式传输规则

I want to check if the subject contains 900 in the third group of characters and the numbers after 900 are dynamic and is a single word.我想检查主题是否在第三组字符中包含900,并且900之后的数字是动态的并且是单个单词。

For example: Subject 1 - 1365 1049126 9003175245 19382_ST03例如:主题 1 - 1365 1049126 9003175245 19382_ST03

Subject 2 - 2455 3245626 9003175000 19382_ST03主题 2 - 2455 3245626 9003175000 19382_ST03

Subject 3 - 4567 4449126 9003005030 19382_ST03主题 3 - 4567 4449126 9003005030 19382_ST03

How do I set this in regular expression?如何在正则表达式中设置它? Any help will be appreciated.任何帮助将不胜感激。

You could use something like this: ^[0-9]{4}\s[0-9]{7}\s900[0-9]{7}\s\w{10}$你可以这样使用: ^[0-9]{4}\s[0-9]{7}\s900[0-9]{7}\s\w{10}$
^ Matches start of strings ^匹配字符串的开头
[0-9]{4}\s Matches 4 digits and whitespace after them [0-9]{4}\s匹配 4 位数字和后面的空格
[0-9]{7}\s Does the same but for 7 digits [0-9]{7}\s相同,但为 7 位数
900[0-9]{7}\s <-- This matches 900 and 7 digits and whitespace 900[0-9]{7}\s <-- 这匹配 900 和 7 位数字和空格
\w{10}s Matches 10 word characters \w{10}s匹配 10 个单词字符
$ Matches end of string $匹配字符串的结尾
If these groups are not ONLY digits, you can replace [0-9] with \w如果这些组不是 ONLY 数字,您可以将[0-9]替换为\w

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM