Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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:
- {user} could consist only of letters and digits; the symbols ".", "-" and "_" can appear between them.
- Examples of valid users: "stephan", "mike03", "s.johnson", "st_steward", "softuni-bulgaria", "12345"
- Examples of invalid users: ''--123", ".....", "nakov_-", "_steve", ".info"
- {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.
- Examples of valid hosts: "softuni.bg", "software-university.com", "intoprogramming.info", "mail.softuni.org"
- Examples of invalid hosts: "helloworld", ".unknown.soft." , "invalid-host-", "invalid-"
- Examples of valid emails: [email protected], [email protected], [email protected], [email protected], [email protected]
- Examples of invalid emails: [email protected], …@mail.bg, [email protected], [email protected], mike@helloworld, [email protected]., s.johnson@invalid-
- Examples
- Input
- Please contact us at: [email protected].
- Output
- Input
- Just send email to [email protected] and [email protected] for more information.
- Output
- Input
- Many users @ SoftUni confuse email addresses. We @ Softuni.BG provide high-quality training @ home or @ class. –- [email protected].
- Output
Add Comment
Please, Sign In to add comment