Title |
Test
Find
Find URL in text
|
Expression |
/((https?|ftp)\:\/\/)?([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?(([a-z0-9-.]*)\.([a-z]{2,6}))|(([0-9]{1,3}\.){3}[0-9]{1,3})(\:[0-9]{2,5})?(\/([a-z0-9+\$_-]\.?)+)*\/?(\?[a-z+&\$_.-][a-z0-9;:@&%=+\/\$_.-]*)?(#[a-z_.-][a-z0-9+\$_.-]*)?/i |
Description |
This could be most complete and readable URL-finder regex. I built it from several good examples. Works with PHP preg_match_all(). Finds whatever string that resembles a URL with scheme://, user:password, subdomains.domain (with up to 6 chars top-domain) or IP address xxx.xxx.xxx.xxx, :port, /file/path/, ?request, and #anchor |
Matches |
google.com |
Non-Matches |
file://hello.txt |
Author |
Rating:
Marco Alvarado
|
Source |
|
Your Rating |
|
Title: it is also matching this..http://www.google is not correct in any format....
Name: Tirumal
Date: 6/3/2016 10:40:31 AM
Comment:
it is working with all other but it is allowing with out any domain name like .com or .co.in or.in
Title: Excellent!
Name: thanos
Date: 1/29/2012 11:45:06 AM
Comment:
you sir have saved my day! Cheers!!