Search Postgresql Archives

Re: order of (escaped) characters in regex range

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

 



True, but still weird...

And are you sure it does the same thing?

2011/12/13 Szymon Guz <mabewlun@xxxxxxxxx>


On 13 December 2011 14:04, InterRob <rob.marjot@xxxxxxxxx> wrote:
Dear List,

I found this interesting:

SELECT regexp_matches('123-A' , E'(3[A-Z\- ])');
ERROR:  invalid regular _expression_: invalid character range

whereas:
SELECT regexp_matches('123-A' , E'(3[\- A-Z])');
 regexp_matches
----------------
 {3-}
(1 row)

Notice the order of (escaped) characters and ranges in the last bit of the _expression_.

Am I missing some key concept of the regular _expression_?

Regards,
Rob

Hi Rob,
try '\\-' instead of '\-'
and it works :)

regards
Szymon


[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