| От | Andrew Merrill |
|---|---|
| Тема | regexp strangeness |
| Дата | |
| Msg-id | 37010D69.6D1868ED@compclass.com обсуждение исходный текст |
| Список | pgsql-sql |
I'm using PostgreSQL 6.4.2 regexps, and they don't seem to work the way I'm used to (Perl). Here's the records in a simple table: select * from t5 where name ~ 'bar'; name -------- bar abar xbar not abar (4 rows) I'd like to match the ones that begin with 'bar' or 'abar'. select * from t5 where name ~ '^a?bar'; name ---- abar (1 row) select * from t5 where name ~ '^bar|^abar'; name ---- (0 rows) Neither of these works. I looked at pgsql/src/backend/regex/re_format.7, and it claims that ^, ?, and | all work as expected. The type of name is varchar(30), in case that is relevant. Am I misunderstanding PostgreSQL's use of regexps, or is this a bug others have seen? Thanks for your help. Andrew Merrill
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера