I've been coding for over 20 years now! (WOAH, do I feel old)
I've touched just about every resource imaginable under the Sun (too bad they were bought out by Oracle)
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.
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 :)
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 :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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...
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 :)