Get a url from a string
I would like to be able to find the url(s) in the given string. It does not always have http:// before it and it's not always a .com domain, so it's a little tricky. I don't care if this find things such as ASP.net or 5.6 because it's how it's going to work.
So basically, i need a way to strip out strings that have a period in them with no space before or after the period. For example, the following string would output the following (possible) url's
google.com offers a variety of ways to discover new websites. You can learn about asp.net and .net framework, depending on your search.
According to the site this script corresponds with, it would return "google.com", "asp.net" and ".net" as a possible url, so apparently if a period has a letter after it, it's a url.
regex for fqdn. something like this may/may not be 100% accurate or working off top of head without any form of testing
I tried executing that hinch, all it returned was this:
I remember coming across this online Regex test tool, might be useful for any future needs.
|All times are GMT +1. The time now is 10:12 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.