Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Phoenix Kiula" <phoenix.kiula@xxxxxxxxx> 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.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux