DEV Community

[Comment from a deleted post]
Collapse
 
darkain profile image
Vincent Milum Jr

It is NOT recommended to use regular expressions to validate things like URLs or especially email addresses. They miss far too much of the actual valid spec. Its especially troublesome considering that PHP has built in functions to do this already.

php.net/manual/en/function.filter-...

If you'd like an example of an actual RFC compliant regular expression for email address validation, check this out, and then please understand why it is a terrible idea to implement it :)

ex-parrot.com/~pdw/Mail-RFC822-Add...

Collapse
 
webdeasy profile image
webdeasy.de

Thanks for your comment! I will add a note with this hint. But for example: I have three different URL validations for different purposes. Only matching a specific protocol and stuff like that...hope you know what I mean :)