| От | Tom Lane |
|---|---|
| Тема | Re: PL/PGSQL Regexe |
| Дата | |
| Msg-id | 28279.1000909202@sss.pgh.pa.us обсуждение |
| Ответ на | PL/PGSQL Regexe (rdear <rdear@dev.internal>) |
| Список | pgsql-sql |
rdear <rdear@dev.internal> writes:
> I'm doing a check within a PL/PGSQL function using a regular expression
> and I get the error:
> ERROR: regcomp failed with error invalid character range
> This appears to be because of the underscore "_" character. The regex I
> want to use is ''[A-Za-z0-9_]'' but this doesn't work.
Seems to work for me:
regression=# select 'a' ~ '[A-Za-z0-9_]';?column?
----------t
(1 row)
regression=# select '_' ~ '[A-Za-z0-9_]';?column?
----------t
(1 row)
regression=# select ':' ~ '[A-Za-z0-9_]';?column?
----------f
(1 row)
How old is your Postgres? (I can tell by the spelling of the error
message that it's not current.)
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера