Re: BUG #4438: regexpression gives the error by working with [
В списке pgsql-bugs по дате отправления:
| От | hubert depesz lubaczewski |
|---|---|
| Тема | Re: BUG #4438: regexpression gives the error by working with [ |
| Дата | |
| Msg-id | 20080927075558.GA7867@depesz.com обсуждение исходный текст |
| Ответ на | BUG #4438: regexpression gives the error by working with [ ("Anatoli Lau" <ailau@sharematrix.com>) |
| Список | pgsql-bugs |
On Sat, Sep 27, 2008 at 12:46:31AM +0000, Anatoli Lau wrote:
> select regexp_matches('/a/b[534]', E'(.*)\[([0-9]*)\]');
> always gives the error but
> select regexp_matches('/a/b{534}', E'(.*)\{([0-9]*)\}');
> works good, the problems comes up only when '[' used
it would be good to show what kind of error it shows. i can only guess
that you are running it through psql, and the error you get is:
ERROR: invalid regular expression: parentheses () not balanced
in such case, change "\[" to "\\[":
# select regexp_matches('/a/b[534]', E'(.*)\\[([0-9]*)\\]');
regexp_matches
----------------
{/a/b,534}
(1 row)
depesz
--
Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера