0Pricing
NLP Academy · Lektion

E-Mail-Adressen und URLs finden

Kontaktinformationen aus unstrukturiertem Text extrahieren

E-Mail-Adressen und URLs finden ist eine kostenlose NLP Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des NLP Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der NLP Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

Patterns Hide in Messy Text

Real text is full of structured snippets like emails and links. Regex lets you pull these out automatically, even from long, messy documents.

What an Email Looks Like

An email has a name, an at sign, a domain, and an extension. Spotting that shape is the first step to writing a pattern for it.

A Simple Email Pattern

This email pattern grabs word characters, an at sign, more characters, a dot, and letters. It is not perfect, but it catches most real addresses.

re.findall("\w+@\w+\.\w+", "hi a@b.com")

Why the Dot Needs Escaping

In a domain you want a literal dot, not the any-character dot. So you escape it as \. to match only a real period in the address.

Extracting Many Emails at Once

Pair your email pattern with re.findall to sweep an entire document and return every address it contains as a clean Python list.

emails = re.findall(pattern, text)

What a URL Looks Like

A URL usually starts with http or https, then ://, then a domain and path. That predictable start makes it a great target for regex.

A Starter URL Pattern

This URL pattern matches http or https, then any non-space characters. The optional s after http is written with a question mark quantifier.

re.findall("https?://\S+", text)

Optional Parts With the Question Mark

The question mark makes the part before it optional. In https? the s may or may not be there, so both http and https match cleanly.

Greedy Matching Can Overreach

By default quantifiers are greedy and grab as much as they can. With URLs this can swallow trailing punctuation you did not want.

Tame It With Boundaries

Use \S to stop at the first space, or trim the result afterward. Knowing where a match should end keeps your extraction tidy.

Test on Real Samples

Always test your pattern on messy real text. Edge cases like plus signs in emails or query strings in URLs reveal where it still leaks.

Quick Check

You want http to be optional in the s only. Which symbol makes the preceding character optional?

Recap: Pulling Out Contact Info

You built patterns for emails and URLs, escaped literal dots, and used the question mark for optional parts. Now you can mine contact info from text. 🔍

Häufig gestellte Fragen

Ist die Lektion „E-Mail-Adressen und URLs finden“ kostenlos?

Ja — der vollständige Text von „E-Mail-Adressen und URLs finden“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des NLP Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der NLP Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „E-Mail-Adressen und URLs finden“?

Kontaktinformationen aus unstrukturiertem Text extrahieren Du übst NLP Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um NLP Academy zu starten?

Keine Vorkenntnisse erforderlich. NLP Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.

Wie lange dauert die Lektion „E-Mail-Adressen und URLs finden“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser NLP Academy-Lektion Code schreiben und ausführen?

Ja. Jede NLP Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Regex in 5 Minuten
  2. E-Mail-Adressen und URLs finden
  3. Erfassungsgruppen und Ersetzungen
  4. Tricks zur Regex-Tokenisierung
← Zurück zu NLP Academy