Wie füge ich in Notepad++ jeder Zeile Text mit unterschiedlichem Inhalt hinzu?

Wie füge ich in Notepad++ jeder Zeile Text mit unterschiedlichem Inhalt hinzu?

Ich habe folgenden Text:

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

Und ich möchte ein Ergebnis erhalten:

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

Wie mache ich?

Antwort1

Klicken Sie auf Ctrl+H

  • Finde was:^.+(@.+)(:).+?$
  • Ersetzen mit$1$2Email\.$1
  • Stellen Sie den Suchmodus auf „Regulärer Ausdruck“ ein.

Bild:

Antwort2

  • Ctrl+H
  • Finde was:^.+@([^:]+):.+$
  • Ersetzen mit:$1:Email.$1
  • ÜBERPRÜFEN Umwickeln
  • ÜBERPRÜFEN Regulären Ausdruck
  • DEAKTIVIEREN . matches newline
  • Replace all

Erläuterung:

^               # 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
$

Ersatz:

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

Screenshot (vorher):

Bildbeschreibung hier eingeben

Screenshot (nachher):

Bildbeschreibung hier eingeben

verwandte Informationen