Participate in Codex, Test Your Skills & Win BIG

Valid Email Address

Write a bash script that finds all the invalid email addresses.

For simplicity, assume that a vaild email addresses has the following rules-

  • Email should be of the form
  • There can only be alphanumberic characters in the local part email address.
  • The following characters are valid in the local part of the email as long as they are not the first character.
    -, _, +, .

  • Email address can not start with a number.
  • Domain name can only contain alphanumeric characters and -.
  • com part can have atmost one ., for e.g. or is valid but is invalid


Assume that input has the following content:

Your script should output the following:

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Valid Email Address on Interview Code Editor
  • Hint 1
  • Solution Approach
  • Complete Solution


Click here to start solving coding interview questions