Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Extract Email Addresses | Introduction to Regular Expressions
Python Regular Expressions

bookChallenge: Extract Email Addresses

Use your knowledge of character classes and quantifiers to extract all email addresses from a block of text. Email addresses follow specific patterns, making them ideal candidates for regular expression matching. Your goal is to write a function that scans a given string and returns every email address it finds.

  • Identify the pattern of a typical email address (for example, username@example.com);
  • Use Python's re module to construct a regular expression that matches email addresses;
  • Write a function that returns a list of all email addresses found in the input string.
Aufgabe

Swipe to start coding

Create a function that scans a given string and finds every email address present. Use the Python regular expressions module to build a pattern that matches standard email addresses. Your function should return a list of all email addresses found, listed in the same order as they appear in the input text.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Suggested prompts:

Can you show me an example of the input text you want to extract emails from?

What should the function do if no email addresses are found in the text?

Do you want the regular expression to handle unusual or edge-case email formats?

close

Awesome!

Completion rate improved to 6.67

bookChallenge: Extract Email Addresses

Swipe um das Menü anzuzeigen

Use your knowledge of character classes and quantifiers to extract all email addresses from a block of text. Email addresses follow specific patterns, making them ideal candidates for regular expression matching. Your goal is to write a function that scans a given string and returns every email address it finds.

  • Identify the pattern of a typical email address (for example, username@example.com);
  • Use Python's re module to construct a regular expression that matches email addresses;
  • Write a function that returns a list of all email addresses found in the input string.
Aufgabe

Swipe to start coding

Create a function that scans a given string and finds every email address present. Use the Python regular expressions module to build a pattern that matches standard email addresses. Your function should return a list of all email addresses found, listed in the same order as they appear in the input text.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

some-alt