스플리터 앞 줄에서 중복된 사용자 이름을 제거하고 이 사용자 이름의 첫 번째 줄만 유지하고 싶습니다.
라인 예:
zzzz:000000zl
zzzz:000000zl!
zzzz:000000zl1
zzzz:000000zl123
zzzz:000000zl69
zzzz:000000zl?
AdSFF12:Sample198445
AdSFF12:Sample198445!
AdSFF12:Sample198445#
AdSFF12:Sample198445$
AdSFF12:Sample1984456
TestOf13:Smpletest1211
TestOf13:Smpletest1211!
TestOf13:Smpletest1211#
TestOf13:Smpletest1211$
TestOf13:Smpletest12112
TestOf13:Smpletest561
TestOf13:Smpletest561!
TestOf13:Smpletest561#
TestOf13:Smpletest561$
TestOf13:Smpletest5612
TestOf13:SmpletestZ2
TestOf13:SmpletestZ2!
TestOf13:SmpletestZ2#
TestOf13:SmpletestZ2$
TestOf13:SmpletestZ23
TestOf13:Smpletestz3qwe
TestOf13:Smpletestz3qwe!
TestOf13:Smpletestz3qwe1
TestOf13:Smpletestz3qwe123
TestOf13:Smpletestz3qwe69
TestOf13:Smpletestz3qwe?
필요한 결과:
zzzz:000000zl
AdSFF12:Sample198445
TestOf13:Smpletest1211
귀하의 도움은 매우 감사하겠습니다. 미리 감사드립니다 <3.
답변1
- Ctrl+H
- 무엇을 찾다:
^((.*?:).+\R)(\2.+\R)+
- 다음으로 교체:
$1
- 확인하다 줄 바꿈
- 확인하다 정규식
- 선택 취소
. matches newline
- Replace all
설명:
^ # beginning of line
( # start group 1
( # start group 2
.*? # 0 or more any character but newline, not greedy
: # a colon
) # end group 2
.+ # 0 or more any character but newline
\R # any kind of linebreak (i.e. \r, \n, \r\n)
) # end group 1
( # group 3, you can use (?: for non capture group
\2 # back reference to group 2 (i.e. the part before the colon)
.+ # 0 or more any character but newline
\R # any kind of linebreak (i.e. \r, \n, \r\n)
)+ # end of group 3, may appear 0 or more times
대사:
$1 # content of group 1, the value of the first line
스크린샷(이전):
스크린샷(이후):