At 18.24 27/3/01 +0200, you wrote:
>Hello,
>
>I'm developing a search tool with php against a posgresql database.
>As the database is in catalan an in spanish is obvious that a simple
>search like:
>(SELECT * FROM painters WHERE artist_name ~* 'Dali');
>
>should perform over Dd Aa Ll Ii (and will not found Dalí).
>but on an accent based language also should perform over ÍíÌìÏï
>
>question is:
>
>this c function from Patrice Hédé is the most appropiate tool for
>searching on an accent based language ?
>http://www.postgresql.org/mhonarc/pgsql-sql/1998-06/msg00119.html
>
>or should I use an implemented function inside postgres right now ?
>
>bests from barcelona,
>jaume teixi.
Using regular expressions from PHP you can convert "a" into "[Aaáä]" and
from the original SQL query:
(SELECT * FROM painters WHERE artist_name ~* 'Dali');
You obtain
(SELECT * FROM painters WHERE artist_name ~* 'D[Aaáä]l[Iiíï]');
generating a new complete regular expression for the SQL language.
It should be valid for Dali, Dáli, Dalí, Dálí, and others.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Lizano - Director área técnica
correo-e: david.lizano@izanet.com
I Z A N E T - Servicios integrales de internet.
web: http://www.izanet.com/
Dirección: C/ Checa, 57-59, 3º D - 50.007 Zaragoza (España)
Teléfono: +34 976 25 80 23 Fax: +34 976 25 80 24
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~