1
xiangyuecn 2019-02-22 18:51:50 +08:00 1
邮件头格式还是蛮复杂的,可能跨多行
To: ([^\r\n]+(?:\r\n\s+[^\r\n]+)*) |
2
Telegram 2019-02-22 18:55:15 +08:00 1
注意冒号:
=\?[^:]*\?= |
3
Telegram 2019-02-22 18:57:23 +08:00 1
从 To:开始,?=结尾,中间不能含有冒号:,问题解决
|
4
laoyur 2019-02-22 18:57:27 +08:00 1
To: (?:\s*=\?.+?\?=\s*,?)+
|
5
xiangyuecn 2019-02-22 18:57:44 +08:00
\r\n 有点问题。。。不研究了
|
6
Raisu 2019-02-22 18:58:13 +08:00 via Android
用 split
|
7
lastpass 2019-02-22 19:12:41 +08:00 via Android
用 antlr
|
9
bzw875 2019-02-22 19:18:32 +08:00
str = str.split('fuck:')[0]
str = str.replace('To', '') |
10
junkman 2019-02-22 19:23:22 +08:00 1
To:( =\?.*\?= )(Cc|Subject):
NOTE: Assume `Subject' always present see: https://regex101.com/r/l7xxeN/2/ |
11
junkman 2019-02-22 19:25:44 +08:00
Only one addressee case failed :-(
|
12
bzw875 2019-02-22 19:26:28 +08:00
str = str.split('Cc:')[0];
str = str.replace('To', ''); 不小心写错了,其实代码可以实现的地方,别用正则表达式,可读性差 |