Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

REGEX For Emails

3 posts in General Discussion Last posting was on 2012-06-26 20:29:34.0Z
Gus Posted on 2012-06-26 17:03:49.0Z
Sender: 5815.4fe9e94e.1804289383@sybase.com
From: Gus
Newsgroups: sybase.public.ase.general
Subject: REGEX For Emails
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4fe9eb75.5853.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 26 Jun 2012 10:03:49 -0700
X-Trace: forums-1-dub 1340730229 172.20.134.41 (26 Jun 2012 10:03:49 -0700)
X-Original-Trace: 26 Jun 2012 10:03:49 -0700, 172.20.134.41
Lines: 7
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31207
Article PK: 74095

Hello, I am trying to create a Regular Expression in that
will check for valid email address. I am new to Sybase and I
would like to know if there is an example on how to do this.

Thank you,

Gus G.


Michael Peppler [Team Sybase] Posted on 2012-06-26 19:27:50.0Z
From: "Michael Peppler [Team Sybase]" <mpeppler@peppler.org>
Organization: Peppler Consulting SARL
Subject: Re: REGEX For Emails
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Message-ID: <pan.2012.06.26.19.29.16.183504@peppler.org>
Newsgroups: sybase.public.ase.general
References: <4fe9eb75.5853.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 26 Jun 2012 12:27:50 -0700
X-Trace: forums-1-dub 1340738870 172.20.134.152 (26 Jun 2012 12:27:50 -0700)
X-Original-Trace: 26 Jun 2012 12:27:50 -0700, vip152.sybase.com
Lines: 15
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31208
Article PK: 74096


On Tue, 26 Jun 2012 10:03:49 -0700, Gus wrote:

> Hello, I am trying to create a Regular Expression in that will check for
> valid email address. I am new to Sybase and I would like to know if there
> is an example on how to do this.

Actually Sybase ASE does not have a reg-exp engine, so you wouldn't be
able to do this in T-SQL.

A LIKE pattern could maybe be used, but it would be rather difficult to
get right - maybe something like '%@%.%' could work, but it would
certainly not garantee that the email address is valid...

Michael


Mark Posted on 2012-06-26 20:29:34.0Z
From: Mark <mlibner@yahoo.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: REGEX For Emails
References: <4fe9eb75.5853.1681692777@sybase.com> <pan.2012.06.26.19.29.16.183504@peppler.org>
In-Reply-To: <pan.2012.06.26.19.29.16.183504@peppler.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4fea1bae$1@forums-1-dub>
Date: 26 Jun 2012 13:29:34 -0700
X-Trace: forums-1-dub 1340742574 172.20.134.152 (26 Jun 2012 13:29:34 -0700)
X-Original-Trace: 26 Jun 2012 13:29:34 -0700, vip152.sybase.com
Lines: 27
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31210
Article PK: 74100

Here's one I found (maybe on here) and added to it.

select @li_ok = 1
where @as_email not like '%[^a-z,0-9,@,.,_,-]%' -- validate the content
of the string
and @as_email like '%_@_%_.__%' -- validate the format of the string

hth,
Mark

On 6/26/2012 3:27 PM, Michael Peppler [Team Sybase] wrote:
> On Tue, 26 Jun 2012 10:03:49 -0700, Gus wrote:
>
>> Hello, I am trying to create a Regular Expression in that will check for
>> valid email address. I am new to Sybase and I would like to know if there
>> is an example on how to do this.
>
> Actually Sybase ASE does not have a reg-exp engine, so you wouldn't be
> able to do this in T-SQL.
>
> A LIKE pattern could maybe be used, but it would be rather difficult to
> get right - maybe something like '%@%.%' could work, but it would
> certainly not garantee that the email address is valid...
>
> Michael
>