Re: list non alphanumeric - Mailing list pgsql-general

From Ian Lawrence Barwick
Subject Re: list non alphanumeric
Date
Msg-id CAB8KJ=huN-E7nbXC8pBH1vgvqcuu7wyYJ-x7tYe9mprUX_XOZA@mail.gmail.com
Whole thread Raw
In response to Re: list non alphanumeric  ("Baboo, Isa" <IBaboo@fnb.co.za>)
Responses Re: list non alphanumeric
List pgsql-general
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of John R Pierce
> Sent: 12 April 2013 08:41 AM
> To: pgsql-general@postgresql.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@fnb.co.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


pgsql-general by date:

Previous
From: "Baboo, Isa"
Date:
Subject: Re: list non alphanumeric
Next
From: John R Pierce
Date:
Subject: Re: list non alphanumeric