rimad Posted December 5, 2006 Share Posted December 5, 2006 I aksed around, no one knows. Here is my problem:-> I simply want to match all utf8 alphabetic characters <-Example provided in manual for preg_match on php.net website doesn't work properly, preg_match("/[\w\pL]/u",$var); works for most (german/scnadinavian) characters but if i use some cirilic characters like " Срећа " it fails. I know perl works properly, its utf8 aware and when i do $string =~ /\w/ if $string is utf8 encoded, it will match all alphabetic utf8 characters. I also read on php website that its PCRE aware, well...i set locale to many many things, en_US.utf8, en_US, only UTF8...nothing changes.Please help!! Quote Link to comment Share on other sites More sharing options...
effigy Posted December 11, 2006 Share Posted December 11, 2006 This matches for me:[code]<meta charset="utf-8"><pre><?php $h_stroke = pack('c*', 0xC4, 0xA7); echo $string = "Cpe${h_stroke}a"; preg_match_all('/[\w\pL]/u', $string, $matches); echo '<br/>'; print_r($matches);?></pre>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.