Email Parser Program:
Now days every body of us has email addresses to make contact with each other. The email addresses usually consist of three parts. First is the prefix or user id that is immediately followed by the character ‘@’. Then comes a unique domain name that ends at the occurrence of a dot (.). Finally after the dot, there is a three-character extension such as com, net or edu. A sample email address may be:
myName@yahoo.com
For this assignment, you have to write a program that takes a series of email addresses as a command-line argument and, after parsing/processing the input, display the addresses separately and in alphabetical order at the command window. For example if the email addresses are provided as a long concatenated string like the following:
myname@yahoo.comyour_pet_name@earthmix.orgwonderful3@badar.edu
And then the result shown on the command window should be something like:
myname@yahoo.com
wonderful3@badar.edu
your_pet_name@earthmix.org
In order to qualify as an email address acceptable to us, every entry must be conforming to the following criterion:
• The prefix or the user-id (i.e. the characters before @) should contain at least 6 and maximum of 15 characters.
• The domain name (i.e. the characters after @ and before dot) should contain at least 3 and maximum of 8 characters.
• The extension (i.e. the characters after dot) must contain exactly 3 characters.
• The extension must be one of the following three types: com, org and edu.
Any email address not conforming to the above criteria must be ignored and not displayed in the final output. For example if the input string is:
thenameofmyfriend@yahoo.commy_name@usa.netwonderful1@badar.edu
Then the result shown on the command window should only be:
wonderful1@badar.edu