Hello,
Thanks!! I also need it to work on any domain name and just return the
domainname.TopLevelDomain
Thanks,
Jack
"Shane Thomas" <nothanks@goaway.com> wrote in message
news:1178chuspj0ree8@corp.supernews.com...[color=blue]
> "Jack" <jouin@webfoxmail.com> wrote in message news:jouin@webfoxmail.com:
>[color=green]
>> Hello,
>>
>> I need to get:
>>
>> microsoft.com
>>
>> From these possible string:
>>
>>
www.microsoft.com
>>
http://www.microsoft.com
>>
http://microsoft.com
>> microsoft.com
>> sql.microsoft.com
>> htttp://sql.microsoft.com[/color]
>
> Regular Expressions is one way.
>
> Imports System.Text.RegularExpressions
> ...
> Dim rx As Regex = New Regex("(?<1>microsoft.com)")
> Dim mt As Match = rx.Match("http://www.whatever.microsoft.com")
> If mt.Success Then
> retval = mt.Groups(1).ToString
> End If
>
> There's decent pattern matching help in MSDN and Google.
>
> --
>
> -shane
>
> Shane Thomas
> HSI [
http://www.hsisoft.com]
>
>[/color]