예를 들어 @
대신 [at]
을 사용하는 것처럼 이메일 주소와 숨겨진 유사 이메일 주소가 포함 된 행이 있습니다. 전자 메일 주소가 아닌 모든 항목에서이 목록을 정리하고 싶습니다.Regex로 이메일 주소가 아닌 모든 것을 제거합니다.
TLD를이 .com
, .us
및 .me
샘플 입력
[email protected]
johndoe @example.us
contant johndoe @ example . me
my email is [email protected]
[email protected] is my email
this johndoe @ example.com is my mail
johndoe[at]example.com
my email is johndoe [at] example.com
johndoe[at-sign]example.com
johndoe at example.com
johndoe[at-sign]example[dot]com is my mail
Lorem ipsum dolor sit amet, consectetur adipisicing elit, johndoe[at-sign]example[dot]us
johndoe[at-sign]example[dot]me labore et dolore magna aliqua
Sed do eiusmod tempor incididunt johndoe at example dot com
Duis aute irure dolor in reprehenderit in voluptate JOHNDOE at EXAMPLE dot US aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum johndoe at example dot me
내가 메모장 ++ 검색을 사용하고 교체하고 내 시도는이 [\w]+(|\s)(@|at|\[at\]|\[at-sign\])(|\s)[\w]+(|\s)(\.|dot)(|\s)(com|us|me)
이며 모든 것을하지만 라인 (11)에 작동하는 것입니다, 12, 13 및 15입니다.
이 글은 독자적으로 작성했으며, 올바른 방법입니까?
원하는 출력 :
[email protected]
[email protected]
johndoe @ example . me
[email protected]
[email protected]
[email protected]
johndoe[at]example.com
johndoe [at] example.com
johndoe[at-sign]example.com
johndoe [at-sign] example.com
johndoe[at-sign]example[dot]com
johndoe[at-sign]example[dot]us
johndoe[at-sign]example[dot]me
johndoe at example dot com
JOHNDOE at EXAMPLE dot US
johndoe at exampledotme
은 내가 e-mail validation can be hard 읽었습니다 때문에이 100 % 방탄 것으로 기대하지 않습니다.
줄마다 하나의 이메일이 항상 존재합니까? – sp00m
예, 가능합니다. –
내 이메일은'.net'로 끝나며, FYI는 완벽하게 유효합니다. – h2ooooooo