trend Posted August 25, 2005 Posted August 25, 2005 I am trying to search through a txt document line by line and get any webpage out of it. I have been learning about regex.. but I believe this will just return the whole line of there is a webaddress on it. (to recap, I want any address..something like http://www.a.com, http://www.bcr.com, http://www.yada.com, http://www.etc.com) I am trying to use: Dim rx As New Regex("www\.*[\.net|\.com|\.org]") But this is just returning the whole line (I think?) What should I do to just return the website's url? thanks Lee Quote
IngisKahn Posted August 25, 2005 Posted August 25, 2005 (?<=www\.)\S+(?=\.(com|org|co\.|edu|net|xxx)) 1. [] is for matching single characters. 2. Throw in ?: groups if you need better performance. 3. There is a RegEx forum. Quote "Who is John Galt?"
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.