I am Hack Sparrow
Captain of the Internets.

Email validation Regex in PHP

Here is a good regex in PHP which will help you validate a vast number of possible emails, also it is case-insensitive. Useful for checking if an input is a valid email or not. [code] /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i [/code] Below is an example in PHP which validates the va ...

JavaScript Email Validation

If your HTML form accepts an email field, it is a good practice to validate the email before the form is submitted. It is also mandatory to re-validate all user input, including emails for validity at the serverside. In case you are using Node.js, you can use the same regular expression function below to validate emails both on the clientside and the serverside. [code] ...