|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-06-24 11:00 UTC] andrey at cvs dot php dot net
[1999-07-20 17:09 UTC] andrey at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 22:00:01 2026 UTC |
It seems like preg_* doesn't use the locale setting. <?php setlocale("LC_ALL", "no_NO"); $str = "???"; if(preg_match("/\w{3}/", $str, $foo)) { echo "matched \\w{3}\n"; } if(preg_match("/???/", $str, $foo)) { echo "matched ???\n"; } ?> _Should_ match both tests, but only matches the last one. #!/usr/bin/perl use locale; $_ = "???"; if(/\w{3}/) { print "matched \\w{3}\n"; } if(/???/) { print "matched ???\n"; } matches both tests. Rune N. Skillingstad