shortysbest Posted August 4, 2011 Share Posted August 4, 2011 preg_match('`((http)+(s)?:(//)|(www\.))((\w|\.|\-|_)+)(/)?(\S+)?`i', $string, $found_url) Quote Link to comment https://forums.phpfreaks.com/topic/243832-this-php-regexp-works-in-php-but-cant-get-it-to-work-in-javascript/ Share on other sites More sharing options...
TeNDoLLA Posted August 4, 2011 Share Posted August 4, 2011 What have you tried in JS then? Also this is probably wrong section if you need JS help. Quote Link to comment https://forums.phpfreaks.com/topic/243832-this-php-regexp-works-in-php-but-cant-get-it-to-work-in-javascript/#findComment-1251967 Share on other sites More sharing options...
shortysbest Posted August 4, 2011 Author Share Posted August 4, 2011 Actually, oddly enough I just tried it in javascript again, and it worked this timeĀ (Only posted here because the javascript thread doesn't get much traffic, and figured anyone good with regexp could do both) Quote Link to comment https://forums.phpfreaks.com/topic/243832-this-php-regexp-works-in-php-but-cant-get-it-to-work-in-javascript/#findComment-1251969 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.