It's rare for me to ever describe one approach as the "right" way to do something - but for validating data, Filter really is excellent, offering both validating and sanitising filters and generally making it super-easy to clean up incoming variables.
Many of the frameworks offer equivalents, and I'm sure many of those are wrapping this too.
We have all been doing email address validation for a very long time to make sure that the email is correctly formatted.
a "personal_info" and a domain, that is [email protected] The length of the personal_info part may be up to 64 characters long and domain name may be up to 253 characters. The personal_info part contains the following ASCII characters.
To get a valid email id we use a regular expression /^\w ([\.-]?