Re: Regexps -- too complex? - Mailing list pgsql-sql

From Emils Klotins
Subject Re: Regexps -- too complex?
Date
Msg-id 3AE83F36.3905.F1E2D6D@localhost
Whole thread Raw
In response to Regexps -- too complex?  ("Emils Klotins" <emils@grafton.lv>)
List pgsql-sql
> SELECT id, title,publishdate,categoryid FROM articles WHERE
> upper(title) ~ '(BLACK|SERIOUS|SAM)[[:>:]]'::text ;
> 
> I think the proiblem is in trnsalte, not in regexp
> 
> If you have installed apprporiate character encoding in Postgres,
> 'upper' will work!
> 
>  Vladimir

Thanks for the advice, unfortunately, it does not seem to work that 
way.


CREATE TABLE "test" (       "title" text
);
COPY "test" FROM stdin;
Serious Sam ceïâ pie pircçjiem
Black & White gaidîðanas svçtki
Lorgaine: The Black Standard - íeltu varoòeposs
Lorgaine: The Black Standard beta versija
Black&White tomçr neesot spiegu programma
Black & White FAQ
Black & White "ïaunais" FAQ
Black & White - pârdotâkâ spçle ASV
\.


SELECT title FROM test WHERE title ~ '(BLACK|WHITE|SAM)';

yields 8 rows.

SELECT title FROM test WHERE title ~ 
'(BLACK|WHITE|blahblah|SAM)'; 

yields 0 rows!

SELECT title FROM test WHERE title ~ '(BLACK|WHITE|SAM) *'; 
also yields 0 rows!


I dont think this is right no matter what the characters I am using 
there. At least it shouldn't, should it?

Emils


pgsql-sql by date:

Previous
From: "Wei Weng"
Date:
Subject: simulate union in subselect
Next
From: chris Günther
Date:
Subject: realising a counter in an pgpsql-trigger