Connecting Tech Pros Worldwide Forums | Help | Site Map

Extracting web address

jimleon's Avatar
Member
 
Join Date: Nov 2006
Posts: 65
#1: Nov 14 '06
Hi,

I have a table in my database that contains free text fields for our customers. Somewhere embedded in the descriptions are web addresses that I want to extract. I need a query that pulls out these adresses and puts them in a website field on the same record. I'm guessing I would have to search for www in a block of text.

NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,730
#2: Nov 14 '06

re: Extracting web address


What I think you'll need is a function (WebAddr) which returns the web address.
It will need to search for 'http' first (including http:// & https://) and, only if not found, search for 'www.'.
You can use InStr() to find the position in the string.
Any space OR the end of the string can be used to find the end and you can set the return value using Mid().
Reply