Re: Question on the use of bracket expressions in Postgres
В списке pgsql-general по дате отправления:
| От | Harald Fuchs |
|---|---|
| Тема | Re: Question on the use of bracket expressions in Postgres |
| Дата | |
| Msg-id | 87u0da4qd1.fsf@srv.protecting.net обсуждение исходный текст |
| Ответ на | Question on the use of bracket expressions in Postgres (Jimmy Rowe <j.l.rowe@larc.nasa.gov>) |
| Список | pgsql-general |
In article <F96F2B16-2A2A-4A28-97E1-1B00C9902808@myrealbox.com>, Michael Glaesemann <grzm@myrealbox.com> writes: > On Dec 15, 2005, at 0:29 , Jimmy Rowe wrote: >> select * from catalog where file_name like 'abc%def%.200[2-5]%'; >> The following select keeps returning "(0 rows)". > LIKE doesn't consider [2-5] to be a range, but rather the literal > characters '[2-5]'. If you're looking for regex, take a look at the > POSIX regex operator ~ > http://www.postgresql.org/docs/current/interactive/functions- > matching.html#FUNCTIONS-POSIX-REGEXP > See if something like file_name ~ 'abc.*def.*\.200[2-5]' That's not quite the same because LIKE matching is anchored. Try something like file_name ~ '^abc.*def.*\.200[2-5]$'
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера