Re: SUBSTR & INSTR

From: joel garry <joel-garry_at_home.com>
Date: Mon, 16 Jun 2008 10:01:07 -0700 (PDT)
Message-ID: <641cab7c-36b2-4eb1-aebf-28119fbc985e@r37g2000prm.googlegroups.com>


On Jun 16, 9:48 am, Mtek <m..._at_mtekusa.com> wrote:
> Hi,
>
> I'm looking to parse an email.  Say I have an email like this:
>
> johnjo..._at_gmail.abc.def.ghi.com
>
> I basically want johnjo..._at_gmail.abc.def.ghi in one variable and
> the .com in the other.
>
> If the email is this:
>
> jjo..._at_amail.co
>
> The same, I basically want jjo..._at_amail.co in one variable and
> the .com in the other.
>
> I know I have to use SUBSTR & INSTR, but the problem is that I do not
> know how many periods may be in the email address.....
>
> Any takers for some help??
>
> Thanks!
>
> John

Can you not just check whatever is after the last period and decide then? There are only so many domains in the world. See the docs on instr about how to search backwards from the end of the string.

But I must say, one of my domains ends with .to and does not have a .com, so I guess I'm thankful you can't spam me! :-)

jg

--
@home.com is bogus.
Sorry, not drunk enough:  http://www.signonsandiego.com/uniontrib/20080614/news_1b14lerach.html
Received on Mon Jun 16 2008 - 12:01:07 CDT

Original text of this message