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

Поиск
Список
Период
Сортировка
Искать
От
Manuel Sugawara
Тема
Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think)
Дата
Msg-id
m3k5ru5eje.fsf@conexa.fciencias.unam.mx
Ответ на
Список
Дерево обсуждения
FInding "corrupt" values in UTF-8 tables (regexp question, I think) "Phoenix Kiula" <phoenix.kiula@gmail.com>
Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think) Michael Glaesemann <grzm@seespotcode.net>
Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think) "Belinda M. Giardine" <giardine@bx.psu.edu>
Re: FInding "corrupt" values in UTF-8 tables (regexp question, I think) Manuel Sugawara <masm@fciencias.unam.mx>
"Phoenix Kiula"  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.
В списке pgsql-general по дате отправления
От: Phoenix Kiula
Дата:
От: Michael Glaesemann
Дата:
FAQ