#30435 [Opn->Bgs]: Preg_Match ignoring word boundaries

From: Date: Thu, 03 Feb 2005 17:56:49 +0000
Subject: #30435 [Opn->Bgs]: Preg_Match ignoring word boundaries
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-73400@lists.php.net to get a copy of this message
ID: 30435 Updated by: sniper@php.net Reported By: wberg at doce dot ufl dot edu -Status: Open +Status: Bogus Bug Type: PCRE related Operating System: Linux 2.4.21-alpha-r4 PHP Version: 4.3.9 New Comment: Who knows, but not really a bug then. Previous Comments: ------------------------------------------------------------------------ [2005-02-03 15:38:30] wberg at doce dot ufl dot edu I can't. The server is not mine and the administrator only upgrades major releases that are verified stable. However, in the meantime I got it to run properly on the Linux server by adding the following line to the top of my code: setlocale(LC_CTYPE, 'fr_FR'); Since the accents involved are all contained in the French language, this did the job. The question remains, of course, why the Windows version doesn't need this. ------------------------------------------------------------------------ [2005-02-03 04:48:55] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2004-10-15 15:29:57] wberg at doce dot ufl dot edu Actually, I was wrong. Using POSIX does *not* work. It won't find either... ------------------------------------------------------------------------ [2004-10-15 15:27:05] wberg at doce dot ufl dot edu Removing the case insensitivity (i) from the pattern match makes no difference in the outcome. See: http://www.kuruvinda.com/test2.php Using POSIX ereg instead does work. See: http://www.kuruvinda.com/test3.php <?php $Pattern = "[[:<:]][aàáâäå]rm[eèéêë][[:>:]]"; $Blazon = "D'argent, au lion d'azur, armé et lampassé de gueules, (le lion est quelquefois chargé d'une fleur-de-lis d'or, ou d'un écusson d'or à l'aigle éployée de sable)."; print "Pattern: $Pattern<p>Blazon: $Blazon<p>"; # Should print Found if (eregi($Pattern,$Blazon,$regs)) { print "Found"; } else { print "Not Found"; } $Blazon = "D'argent, au lion d'azur, armée et lampassé de gueules, (le lion est quelquefois chargé d'une fleur-de-lis d'or, ou d'un écusson d'or à l'aigle éployée de sable)."; print "<p>Pattern: $Pattern<p>Blazon 2: $Blazon<p>"; # Should print Not Found if (eregi($Pattern,$Blazon,$regs)) { print "Found"; } else { print "Not Found"; } ?> ------------------------------------------------------------------------ [2004-10-15 15:07:10] wberg at doce dot ufl dot edu "The match does not find "armé" as a whole word in $Blazon, but does find it in $Blazon2, although it isn't a whole word there." Should be: The match does not find "armé" as a whole word in Blazon, but does find it in Blazon 2, although it isn't a whole word there. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30435 -- Edit this bug report at http://bugs.php.net/?id=30435&edit=1

« previous php.bugs (#73400) next »