Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте 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.
Завдання

Swipe to start coding

Write a function that scans a text and extracts every email address it contains.

  1. Identify the structure of a typical email address (e.g., name@example.com).
  2. Use Python’s re module to create a regular expression that matches valid email patterns.
  3. Search the input string for all email occurrences.
  4. Return the list of found email addresses in the same order they appear in the text.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

Awesome!

Completion rate improved to 6.67

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.
Завдання

Swipe to start coding

Write a function that scans a text and extracts every email address it contains.

  1. Identify the structure of a typical email address (e.g., name@example.com).
  2. Use Python’s re module to create a regular expression that matches valid email patterns.
  3. Search the input string for all email occurrences.
  4. Return the list of found email addresses in the same order they appear in the text.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

some-alt