order of (escaped) characters in regex range

Поиск
Список
Период
Сортировка
От InterRob
Тема order of (escaped) characters in regex range
Дата
Msg-id CA+DVeYDq5zHNmJwf5t8gtqPhZ0uCgX5qXXnQP2vV4_EtK_Y7rA@mail.gmail.com
обсуждение исходный текст
Ответы Re: order of (escaped) characters in regex range
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: WAL file accumulation on log shipping primary node
Следующее
От: Szymon Guz
Дата:
Сообщение: Re: order of (escaped) characters in regex range