Sichanov

Untitled

Nov 14th, 2021 (edited)
889
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. Write a program which receives a single string and extracts all email addresses from it. Print the extracted email addresses on separate lines. Emails are in the format "{user}@{host}", where:
  2. {user} could consist only of letters and digits; the symbols ".", "-" and "_" can appear between them.
  3. Examples of valid users: "stephan", "mike03", "s.johnson", "st_steward", "softuni-bulgaria", "12345"
  4. Examples of invalid users: ''--123", ".....", "nakov_-", "_steve", ".info"
  5. {host} is a sequence of at least two words, each couple of words must be separated by a single dot ".". Each word consists of only letters and can have hyphens "-" between the letters.
  6. Examples of valid hosts: "softuni.bg", "software-university.com", "intoprogramming.info", "mail.softuni.org"
  7. Examples of invalid hosts: "helloworld", ".unknown.soft." , "invalid-host-", "invalid-"
  8.  
  9. Examples of invalid emails: [email protected], …@mail.bg, [email protected], [email protected], mike@helloworld, [email protected]., s.johnson@invalid-
  10. Examples
  11.  
  12. Input
  13. Please contact us at: [email protected].
  14.  
  15. Output
  16.  
  17. Input
  18. Just send email to [email protected] and [email protected] for more information.
  19.  
  20. Output
  21.  
  22. Input
  23. Many users @ SoftUni confuse email addresses. We @ Softuni.BG provide high-quality training @ home or @ class. –- [email protected].
  24.  
  25. Output
  26.  
Add Comment
Please, Sign In to add comment