Re: SUBSTR & INSTR

From: stephen O'D <stephen.odonnell_at_gmail.com>
Date: Wed, 18 Jun 2008 15:08:20 -0700 (PDT)
Message-ID: <5d6b17a6-ae2d-40f3-9667-66e5969a9be9@j22g2000hsf.googlegroups.com>


On Jun 16, 5:48 pm, 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

Depending on whether you are on Oracle 10G or not, regexp_instr and regexp_substr may be a great help here - http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.html Received on Wed Jun 18 2008 - 17:08:20 CDT

Original text of this message