Email Address Validation
Problem Statement :
Screw the long story lines, lets cut to the chase. Given a list of E-Mail addresses, you need to check if each of them is valid or not. An E-Mail address consists of two parts : the local part of an address (before the @ sign) and the domain part (after the @ sign). Now each of these parts follow their own conventions. To simply the validation, let us assume that these are the only conventions that we need to follow.
Local Part :
- Can contain upper/lower case English letters and digits
- The only symbols allowed are : dots('.'), hyphens('-') and underscores('_')
- Must not begin or end with one of the above mentioned symbols
- The dot symbol('.') cannot appear more than once consecutively
Domain Part (Syntax):
- The top-level domain must consist of at least 2 characters, which are English letters only
- There can be nested sub-domains, (separated by dots ('.')), each of which can contain upper/lower case English letters, digits and hyphens('-'), taking care that it does not begin or end with a symbol
- Needless to say, the dot symbol('.') cannot appear more than once consecutively in the sub-domain
Consists of multiple lines, each containing an E-Mail address. Read till EOF.
For each test case, print out 'Valid' or 'Invalid' after parsing the input string.
Sample Input :
Sample Output :
Problem Setter : Vishnu Mohandas