Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $pattern = '#(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))#';
- return preg_match ($pattern, $url);
- //returns true on match
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement