PHP regex match all urls -
this question has answer here:
i need creating regex match urls example, please not close question duplicate have been looking need long time, , none of answers have seen have given answer solves problem.
website.com
www.website.com
with trailing
www.website.com/path-to-something
i coding shortens url, so, first need match them all.
thanks
this 1 match correctly posted:
preg_match_all('#[-a-za-z0-9@:%_\+.~\#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-za-z0-9@:%_\+.~\#?&//=]*)?#si', $targetstring, $result);
Comments
Post a Comment