strago Posted January 18, 2012 Share Posted January 18, 2012 preg_match_all('/(www.DOMAIN.com\/([^"]+))\"/i', $html, $matches); How do you make this match any URL on the domain including URLs with ? = & type of characters. Link to comment https://forums.phpfreaks.com/topic/255270-tiny-preg_match_all-trouble-match-any-url-on-a-domain/ Share on other sites More sharing options...
Muddy_Funster Posted January 18, 2012 Share Posted January 18, 2012 have you tried including those characters within the regular expression? Link to comment https://forums.phpfreaks.com/topic/255270-tiny-preg_match_all-trouble-match-any-url-on-a-domain/#findComment-1308805 Share on other sites More sharing options...
strago Posted January 18, 2012 Author Share Posted January 18, 2012 preg_match_all('/(www.domain.com\/[a-z0-9-_\.&=:/])\"/i', $html, $matches); and preg_match_all('/(www.domain.com\/((.*))\"/i', $html, $matches); totally kill it. Only with preg_match_all('/(www.domain.com\/([^"]+))\"/i', $html, $matches); or preg_match_all('@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@',$html,$matches); can I get it to partly work. Works with static normal URLs, but not something like domain.com/cgi-bin/file.cgi?whatever=whatever&whatever=whatever%2B-more%2B-stuff%2B-is%2B-here%2B-ok Link to comment https://forums.phpfreaks.com/topic/255270-tiny-preg_match_all-trouble-match-any-url-on-a-domain/#findComment-1308825 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.