someone please explain this regex behaviour

Поиск
Список
Период
Сортировка
От Martin Leja
Тема someone please explain this regex behaviour
Дата
Msg-id 4.3.2.7.2.20010127235532.02bd90d8@vmax.unix-ag.uni-siegen.de
обсуждение исходный текст
Ответы Re: someone please explain this regex behaviour
Список pgsql-general
Hi,

consider the following simple example, where i want to select a path by
using a where clause with the case insensitive operator "~*". Everything is
ok where i get a result of one row, but i don't understand the results with
0 rows:

backup=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.5.3 on i686-pc-linux-gnu, compiled by gcc 2.95.2
(1 row)

backup=> create table foo (path varchar(300));
CREATE
backup=> insert into foo (path) values ('/My');
INSERT 29400 1
backup=> select path from foo where path ~* '/My';
path
----
/My
(1 row)

backup=> select path from foo where path ~* '^/My';
path
----
/My
(1 row)

backup=> select path from foo where path ~* '^/my';
path
----
(0 rows)

backup=> select path from foo where path ~* '/my';
path
----
/My
(1 row)

backup=> select path from foo where path ~* '/mY';
path
----
/My
(1 row)

backup=> select path from foo where path ~* '^/mY';
path
----
(0 rows)


Why e.g. does the statement "select path from foo where path ~* '^/my';"
not return the only entry "/My"? Can someone explain this?
--
Regards, martin@unix-ag.org


В списке pgsql-general по дате отправления:

Предыдущее
От: "Mitch Vincent"
Дата:
Сообщение: varchar => int
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Setting logfile location with pg_ctl and postgres.conf