use of / in ~ vs. ~* - Mailing list pgsql-hackers

From Hannu Krosing
Subject use of / in ~ vs. ~*
Date
Msg-id 39D11C7E.C42282CB@tm.ee
Whole thread Raw
Responses Re: use of / in ~ vs. ~*
List pgsql-hackers
Can anyone explain why I must make / a character class 
in case-insensitive query in order to match / ?

and then why does it work in plain ~ ?

hannu=> select * from item where path ~* '^/a';
path  
------
/a/b/c
/a/b/d
/a/d/d
/aa/d 
/a/b  
/a/c  
/a/d  
(7 rows)

hannu=> select * from item where path ~ '^/a';
path  
------
/a/b/c
/a/b/d
/a/d/d
/aa/d 
/a/b  
/a/c  
/a/d  
(7 rows)

hannu=> select * from item where path ~* '^/A';
path
----
(0 rows)

hannu=> select * from item where path ~* '^[/]A';
path  
------
/a/b/c
/a/b/d
/a/d/d
/aa/d 
/a/b  
/a/c  
/a/d  
(7 rows)

------------
Hannu


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: RE: [GENERAL] update inside transaction violates unique constraint?
Next
From: "Mikheev, Vadim"
Date:
Subject: RE: RE: [GENERAL] update inside transaction violates un ique constraint?