php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54517 word boundary \b fails with Scandinavian alphabet
Submitted: 2011-04-12 21:19 UTC Modified: 2011-04-13 10:40 UTC
From: antti dot nylund at gmail dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.3.6 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: antti dot nylund at gmail dot com
New email:
PHP Version: OS:

 

 [2011-04-12 21:19 UTC] antti dot nylund at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.preg-match-all
---
Word preceding ö ä or å will not be matched/counted.
Tried setting local with setlocale(LC_ALL, "fi_FI");

Test script:
---------------
$teststring = "Talvivaate on talvikäyttöön ja kesävaate on kesäkäyttöön.";
preg_match_all("/\bvaate\b/i",$teststring,$keywords,PREG_OFFSET_CAPTURE); 
$rows = count($keywords[0],0);
echo $rows;




Expected result:
----------------
Should print 2

Actual result:
--------------
Prints out 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-13 10:40 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 [2011-04-13 10:40 UTC] cataphract@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Prints 0 with the u flag, as expected since at least 5.3.4 when the PCRE_UCP started being used when u is present.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC