2013-05-22 1 views
0

정규식을 사용하여 텍스트 파일에서 중복 전자 메일을 제거하는 방법을 알아 내려고했지만 전혀 작동하지 않습니다.Notepad ++ Regular Expression 중복 된 전자 메일 제거

이는 이메일 (예) 나는 모든 중복을 삭제하는 방법을 발견를 havent

[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 

텍스트 파일에 어떻게, 난 단지 직후 있습니다 중복을 삭제하는 정규 표현식의 방법을 발견 서로.

누구에게 의견이 있습니까?

+0

당신은에 도움이 답을 찾을 수 [중복-행을-에서 제거 -notepad ++] (http://stackoverflow.com/a/3958364/1521627) –

답변

0

대해 어떻게 :

검색 : ([^@][email protected][^@]+)(.*?)\1
하기로 교체 : $1$2

정규식 설명 :

The regular expression: 

(?-imsx:([^@][email protected][^@]+)(.*?)\1) 

matches as follows: 

NODE      EXPLANATION 
---------------------------------------------------------------------- 
(?-imsx:     group, but do not capture (case-sensitive) 
         (with^and $ matching normally) (with . not 
         matching \n) (matching whitespace and # 
         normally): 
---------------------------------------------------------------------- 
    (      group and capture to \1: 
---------------------------------------------------------------------- 
    [^@]+     any character except: '@' (1 or more 
          times (matching the most amount 
          possible)) 
---------------------------------------------------------------------- 
    @      '@' 
---------------------------------------------------------------------- 
    [^@]+     any character except: '@' (1 or more 
          times (matching the most amount 
          possible)) 
---------------------------------------------------------------------- 
)      end of \1 
---------------------------------------------------------------------- 
    (      group and capture to \2: 
---------------------------------------------------------------------- 
    .*?      any character except \n (0 or more times 
          (matching the least amount possible)) 
---------------------------------------------------------------------- 
)      end of \2 
---------------------------------------------------------------------- 
    \1      what was matched by capture \1 
---------------------------------------------------------------------- 
)      end of grouping 
----------------------------------------------------------------------