Regular expression for validating email address in c

Email:: Address can be used to extract a list of e-mail addresses from a given string.

For example: examples/email_It properly verifies if an e-mail is valid, it even removes unnecessary white-spaces from both ends of the e-mail address, but it cannot really verify if the given e-mail address is really the address of someone, and if that someone is the same person who typed it in, in a registration form.

Another common use-case is when we get a large text-file (a dump, or a log file) and we need to extract the list of e-mail address from that file.

I think it’s a bit of an overkill for most use cases.

Often, email validation code for web applications checks only for the position of @ and period characters, also assuming the @ character will be in the front of period. Did you know you can use a Java Script Regular Expressions method to check email addresses?

Validating email addresses using regular expressions can be daunting, especially if you read articles like the RFC 822.

Taken from Paul Warren’s page on the RFC822 Perl module: I generally avoid this sort of coding, but it will work in a pinch.

It is better to use regex, at least it is better for your coding skills, as such knowledge will carry over to other languages that can’t use the .

Leave a Reply