Re: list non alphanumeric

From: "Baboo, Isa" <IBaboo(at)fnb(dot)co(dot)za>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: list non alphanumeric
Date: 2013-04-12 07:12:04
Message-ID: EEF91A759041DC4FBB3103789098746C0B3A4CDE@FRGR1D1MX04.services.firstrand.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

It still displaying everything, maybe it is the spaces?

test
sadadds
Hillary
BEN NAME
BOB
/+
...skipping
ALAN MCGARVEY +

-----Original Message-----
From: Ian Lawrence Barwick [mailto:barwick(at)gmail(dot)com]
Sent: 12 April 2013 09:08 AM
To: Baboo, Isa
Cc: John R Pierce; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] list non alphanumeric

> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of John R Pierce
> Sent: 12 April 2013 08:41 AM
> To: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] list non alphanumeric
>
>
>
> On 4/11/2013 11:23 PM, Baboo, Isa wrote:
>
> Firstly let me mention I am a noob to postgres,DB and sql anyway, I
> have a column with First names and need to list names that have
> non-alphanumeric characters in them like + or * and the list goes on.
> I did google a bit and
> tried:
>
> select * from TABLE where first_name not like '%[a-z0-9]%';
>
>
> you'll probably have to use a regex for that.
>
> something like... (my regex is really rusty)
>
> ... WHERE first_name !~ '^[a-z0-9]*$';

2013/4/12 Baboo, Isa <IBaboo(at)fnb(dot)co(dot)za>:
>
> Hi
>
> Thanks for the response but I tried that and it does not work here is
> an example of names which still display.
>
> test
> sadadds
> Hillary
> BEN NAME
> ALAN MCGARVEY +

Something like:

... WHERE first_name ~ '[^\w]'

might do the trick.

Regards

Ian Barwick

To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser:
https://www.fnb.co.za/disclaimer.html

If you are unable to access the Disclaimer, send a blank e-mail to
firstrandbankdisclaimer(at)fnb(dot)co(dot)za and we will send you a copy of the Disclaimer.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Baboo, Isa 2013-04-12 07:16:38 Re: list non alphanumeric
Previous Message Ian Lawrence Barwick 2013-04-12 07:07:36 Re: list non alphanumeric