Select with Regular Expressions

Поиск
Список
Период
Сортировка
Искать
От
Peter Weinzierl
Тема
Select with Regular Expressions
Дата
Msg-id
44017D20.4040401@gmail.com
Список
Дерево обсуждения
Select with Regular Expressions Peter Weinzierl <peter.weinzierl@gmail.com>
Re: Select with Regular Expressions Michael Fuhr <mike@fuhr.org>
Hi,

testing a program I ran into a glitch working with the ~* statement.
The problem is, that whenever I want to query something from the 
database with ~* containing brackets () or a question mark psql throws 
an exception.
So far I have tried to escape the sequence but then I ran into another 
problem. Psql didn't fetch the result I wanted it to fetch (the one with 
the brackets or question mark),
but one that was similiar to the one I wanted it to fetch.
Here's an example:
I want to fetch 'my (search) string' from the table

select bar from table where bar ~*' my (search) string';

This didn't work out so I tried:

select bar from table where bar~*'my \(search\) string';

But this only returned:

'my search string'

and not the wanted result 'my (search) string'.
The problem is, that I have to escape ... the string otherwise my 
program throws an exception.

The language is python.

Thanx in advance

Lucius
В списке pgsql-novice по дате отправления
От: Arnaud Lesauvage
Дата:
Сообщение: View running Processes ?
От: NubeY
Дата:
FAQ