// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?m)(?i)(?<=Empfänger)([\s]*)\b([\S\t ]*)\b").unwrap();
let string = "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.";
let substitution = "";
// result will be a String with the substituted value
let result = regex.replace_all(string, substitution);
println!("{}", result);
}
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 Rust, please visit: https://docs.rs/regex/latest/regex/