php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26330 inconsistent behaviour of \b for win&*nix?
Submitted: 2003-11-20 08:19 UTC Modified: 2003-11-20 19:26 UTC
From: space at outthere dot net Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 4.3.4 OS: win/linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: space at outthere dot net
New email:
PHP Version: OS:

 

 [2003-11-20 08:19 UTC] space at outthere dot net
Description:
------------
running a regexp in windows and later on linux yeilded different results: 

$new = preg_replace("/\b?sterreich\b/i", "A", "Germany ?sterreich France");

will replace on windows systems but will fail on unix boxes. 





Reproduce code:
---------------
$new = preg_replace("/\b?sterreich\b/i", "A", "Germany ?sterreich France");
print $new;




Expected result:
----------------
Germany A France


Actual result:
--------------
win: 
> Germany A France
linux:
> Germany ?sterreich France


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-20 19:26 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

\b is locale dependant and I suspect the locales on your Win32 and Linux servers differ, hence the different behaviour.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 08:01:34 2025 UTC