Notepad++에서 내용이 다른 각 줄에 텍스트를 어떻게 추가합니까?

Notepad++에서 내용이 다른 각 줄에 텍스트를 어떻게 추가합니까?

다음 텍스트가 있습니다.

[email protected]:Golden-Ball
[email protected]:SilverBall
[email protected]:Copper_Ball
[email protected]:Encourage
[email protected]:Not-Engaged

그리고 나는 결과를 얻고 싶습니다 :

yahoo.com:Email.yahoo.com
epfedu.fr:Email.epfedu.fr
staplesnet.us:Email.staplesnet.us
mail.montclair.edu:Email.mail.montclair.edu
stu.howardcollege.edu:Email.stu.howardcollege.edu

어떻게 해야 하나요?

답변1

Ctrl+를 클릭하세요 .H

  • 무엇을 찾다:^.+(@.+)(:).+?$
  • 다음으로 교체$1$2Email\.$1
  • 검색 모드를 정규식으로 설정

이미지:

답변2

  • Ctrl+H
  • 무엇을 찾다:^.+@([^:]+):.+$
  • 다음으로 교체:$1:Email.$1
  • 확인하다 줄 바꿈
  • 확인하다 정규식
  • 선택 취소 . matches newline
  • Replace all

설명:

^               # beginning of line
  .+            # 1 or more any character but newline
  @             # literally @
  ([^:]+)       # group 1, 1 or more any character that is not colon
  :             # a colon
  .+            # 1 or more any character but newline
$

대사:

$1          # content of group 1
:           # a colon
Email       # literally Email
.           # a dot
$1          # content of group 1

스크린샷(이전):

여기에 이미지 설명을 입력하세요

스크린샷(이후):

여기에 이미지 설명을 입력하세요

관련 정보