Current location: Hot Scripts Forums » General Community » Script Requests » Regular Expression to detect URLS


Regular Expression to detect URLS

Reply
  #1 (permalink)  
Old 07-24-11, 01:01 PM
phpcoder24july phpcoder24july is offline
New Member
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Regular Expression to detect URLS

Hi everyone,

I am looking for a regular expression which can extract URLS with extension(jpg,png,gif,mp3,mp4,3gp).At present I have this one
$reg_exUrl = "!(http|https)://([a-z0-9A-Z\-\.\/\_\:\@]+\.(?:jpe?g|png|gif|mp3|mp4|3gp))!Ui"
It works well but for this url=http://190.230.80.163:8080/movies/677025542@190.230.80.163.3gp
It only detects http://190.230.80.163:8080/movies/677025542@190.230

I tried one more $reg_exUrl = "/(http|https)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z0-9]{2,3}(\/\S*)?/"
this gives http://190.230

Any help would be appreciable.
Thanks
Reply With Quote
Reply

Bookmarks

Tags
detect url, php, regular expression


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Regular Expression coolsaggu PHP 3 09-29-08 06:25 AM
Regular Expression mohit Everything Java 9 05-08-08 04:55 AM
Help with regular expression... :) eddyvlad PHP 2 01-08-06 10:10 PM
regular expression for parsing url link musmanm80 Perl 1 07-27-05 11:58 PM
suggest a regular expression gmadhukarreddy Perl 2 01-08-04 12:56 AM


All times are GMT -5. The time now is 10:09 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.