using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?i)(?<=Empfänger)([\s]*)\b([\S\t ]*)\b";
string substitution = @"";
string input = @"Ladeliste: speditions
logistics
GmbH
-
D-9999 Speditionsstadt
Seite 1
Kunde:
Chrsitkind SE (#41155~42784)
16.10.2019 11:20
Sendungs-Nr: 0002011147
Auftrags-Nr: 11161
Frankatur: frei Haus
Depot: 007
Auftraggeber Christkind-
*
(#41155~42784)
9999 Wunderstandt
*
Wunderstraße 001
Empfänger Max Muster TEST
99992 Musterstadt
*
Musterstraße
1
Lieferavis
mustermannmax@gmx.de
Ladezeit
17.10.19
Termin
B2CLine
Hinweis-Schl: nur mit Hebebühne zustellen
Avis Festnetz: 0177007007007 / 000 32586914
S-Zeilen:
1 EE
Saunaaufguss
315
kg 120x080x120 1,152cbm
Calnids
100 340294943036198282
DRAN 000 TTAN
**
1
Sdg., 1 Colli (1 EE), gesamt 315 kg.";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx