ereg() can't recognize characters such as èéêë...

From: Date: Tue, 29 Jul 2003 13:01:46 +0000
Subject: ereg() can't recognize characters such as èéêë...
Groups: php.general 
Request: Send a blank email to php-general+get-157298@lists.php.net to get a copy of this message
Hi list, I read through the manual and tried to find something on google, but I didn't come to anything useful. It seems that the ereg()-family (I tried ereg(), eregi() and ereg_replace()) can't recognize any special characters such as èéêë etc. I tested this : <?php print (ereg("[[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:pri nt:][:punct:][:space:][:upper:][:xdigit:]]","é")); ?> and it returned a blank screen. When I fill in a regular character such as 'e' or a slash or whatever, it returns 1. I ran into this when I tested a script which should replace '{PMID[PubMed ID number]:[First author's name]} into a link to the article online. For instance, "{PMID12632325:Flanigan}" results in "<A href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=PubM ed&amp;dopt=Abstract&amp;list_uids=12632325" target="_blank">Flanigan</A>". This worked all fine, until an author's name was Müller. Then my ereg_replace() failed (below). Any ideas? <?php $val = ereg_replace("{PMID([[:alnum:]. _-]*):([[:alnum:]. _-]*)}", "<A href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=Pub Med&amp;dopt=Abstract&amp;list_uids=\\1\" target=\"_blank\">\\2</A>","{PMID11519736:Müller}"); print ($val); ?> TIA! -- [Win2000 | Apache/1.3.23] [PHP/4.2.3 | MySQL/3.23.53] Ivo Fokkema PHP & MySQL programmer Leiden University Medical Centre Netherlands

« previous php.general (#157298) next »