Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread Yeti
I dont think using all these regular expressions is a very efficient way to do so. As i previously pointed out there are many users who had a similar problem, which can be viewed at: http://it.php.net/manual/en/function.strtr.php One of my favourites is what derernst at gmx dot ch used.

Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread Yeti
Oh, and i forgot about this one ... jorge at seisbits dot com wrote on 11-Jul-2008 09:04 If you try to make a strtr of not usual charafters when you are in a utf8 enviroment, you can do that: function normaliza ($string){ $string = utf8_decode($string); $string = strtr($string, utf8_decode(

Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread Andrew Ballard
On Tue, Jul 15, 2008 at 5:38 AM, Yeti [EMAIL PROTECTED] wrote: I dont think using all these regular expressions is a very efficient way to do so. As i previously pointed out there are many users who had a similar problem, which can be viewed at: http://it.php.net/manual/en/function.strtr.php

Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread Andrew Ballard
On Tue, Jul 15, 2008 at 9:46 AM, Andrew Ballard [EMAIL PROTECTED] wrote: On Tue, Jul 15, 2008 at 5:38 AM, Yeti [EMAIL PROTECTED] wrote: I dont think using all these regular expressions is a very efficient way to do so. As i previously pointed out there are many users who had a similar problem,

Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread tedd
At 10:15 AM -0400 7/15/08, Andrew Ballard wrote: On TueWell, OK, I can think of one optimization. This takes advantage of the fact that preg_replace can accept arrays as parameters. In a couple very quick tests this version is roughly 30% faster than my previous version: -snip- Hey, when you

Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread Andrew Ballard
On Tue, Jul 15, 2008 at 12:30 PM, tedd [EMAIL PROTECTED] wrote: At 10:15 AM -0400 7/15/08, Andrew Ballard wrote: On TueWell, OK, I can think of one optimization. This takes advantage of the fact that preg_replace can accept arrays as parameters. In a couple very quick tests this version is

Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread Yeti
The original problem was User X submits a character string A. A PHP scripts uses A to search for it's occurences in a DB, ignoring special characters. The result of ze search is a list of character strings M-LIST with matches. This list gets outputted to the user X, but before that all the

Re: [PHP] case and accent - insensitive regular expression?

2008-07-15 Thread Andrew Ballard
On Tue, Jul 15, 2008 at 2:07 PM, Yeti [EMAIL PROTECTED] wrote: The original problem was User X submits a character string A. A PHP scripts uses A to search for it's occurences in a DB, ignoring special characters. The result of ze search is a list of character strings M-LIST with matches.

Re: [PHP] case and accent - insensitive regular expression?

2008-07-14 Thread Giulio Mastrosanti
First of all thank you all for your answers, and thank you for your time and yes Tedd, my question was quite ambiguous in that point. Andrew is right, i don't want to change in any way the list of keys I show in the result, I just want to find the way to higlight the matching words,

Re: [PHP] case and accent - insensitive regular expression?

2008-07-14 Thread Andrew Ballard
On Mon, Jul 14, 2008 at 11:06 AM, Giulio Mastrosanti [EMAIL PROTECTED] wrote: First of all thank you all for your answers, and thank you for your time and yes Tedd, my question was quite ambiguous in that point. Andrew is right, i don't want to change in any way the list of keys I show in

Re: [PHP] case and accent - insensitive regular expression?

2008-07-14 Thread Giulio Mastrosanti
Brilliant !!! so you replace every occurence of every accent variation with all the accent variations... OK, that's it! only some more doubts ( regex are still an headhache for me... ) preg_replace('/[iìíîïĩīĭįı]/iu',... -- what's the meaning of iu after the match string?

Re: [PHP] case and accent - insensitive regular expression?

2008-07-14 Thread Andrew Ballard
On Mon, Jul 14, 2008 at 1:35 PM, Giulio Mastrosanti [EMAIL PROTECTED] wrote: Brilliant !!! so you replace every occurence of every accent variation with all the accent variations... OK, that's it! only some more doubts ( regex are still an headhache for me... )

Re: [PHP] case and accent - insensitive regular expression?

2008-07-13 Thread Andrew Ballard
On Sat, Jul 12, 2008 at 10:29 AM, tedd [EMAIL PROTECTED] wrote: At 9:36 AM +0200 7/12/08, Giulio Mastrosanti wrote: Hi, I have a php page that asks user for a key ( or a list of keys ) and then shows a list of items matching the query. every item in the list shows its data, and the list of

Re: [PHP] case and accent - insensitive regular expression?

2008-07-13 Thread tedd
At 8:31 AM -0400 7/13/08, Andrew Ballard wrote: On Sat, Jul 12, 2008 at 10:29 AM, tedd [EMAIL PROTECTED] wrote: At 9:36 AM +0200 7/12/08, Giulio Mastrosanti wrote: Hi, I have a php page that asks user for a key ( or a list of keys ) and then shows a list of items matching the query.

[PHP] case and accent - insensitive regular expression?

2008-07-12 Thread Giulio Mastrosanti
Hi, I have a php page that asks user for a key ( or a list of keys ) and then shows a list of items matching the query. every item in the list shows its data, and the list of keys it has ( a list of comma-separated words ) I would like to higlight, in the list of keys shown for every

Re: [PHP] case and accent - insensitive regular expression?

2008-07-12 Thread tedd
At 9:36 AM +0200 7/12/08, Giulio Mastrosanti wrote: Hi, I have a php page that asks user for a key ( or a list of keys ) and then shows a list of items matching the query. every item in the list shows its data, and the list of keys it has ( a list of comma-separated words ) I would like