Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think)

From: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
To: "Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com>
Cc: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think)
Date: 2007-08-17 16:09:09
Message-ID: m3k5ru5eje.fsf@conexa.fciencias.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com> writes:

>
> select id, t_code
> from traders
> where t_code ~ '[^A-Za-z1-9\-\_]'
> limit 100;
>
> This gives me an error: "ERROR: invalid regular expression: invalid
> character range".

Put the dash at the start of the character class: [^-A-Za-z1-9_]

>
> What am I missing?

In a character class expression the dash has an special meaning. If
you need to match a dash it has to be the first character.

Regards,
Manuel.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2007-08-17 16:19:29 Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think)
Previous Message Phoenix Kiula 2007-08-17 15:58:05 FInding "corrupt" values in UTF-8 tables (regexp question, I think)