It's usually recommended to use filter_var function for validating email addresses in PHP – however, the option of using regex is sometimes selected by the developers. For instance, Codeigniter's email helper is relying on a regular expression for validating email addresses.
What could be the advantage of selecting the regex approach rather than relying on filter_var?
Thank you in advance!
NOTE: This is not a practical question about "how to validate emails in PHP", but a theoretical question regarding PHP best practices. Please read carefully to understand the nature of the question, before marking it as a duplicate of something it does NOT duplicate. Thank you!