【发布时间】:2018-03-15 04:37:29
【问题描述】:
By Mel An, abf@abc.com
By Dem, abc.com / Abc
By Sam, John, Todd, and John
By Jer
我需要一个不匹配email id 的正则表达式。
它应该提供所有文本,除了第一个。即
By Mel An,
By Dem, abc.com / Abc
By Sam, John, Todd, and John
By Jer
我只想使用 JavaScript 正则表达式,我尝试使用 .*(?=,\s.*@.*com),但问题是它只匹配 email id 的情况。如果email id 存在,则不应捕获email id,如果email id 不存在,则应匹配所有文本。
【问题讨论】:
-
到目前为止你做了什么?
-
(.*)(\b(, .*abc.com))
-
^((?!.*@.*com).)*$
标签: javascript regex