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!! Link to comment https://forums.phpfreaks.com/topic/29486-attention-never-solved-pattern/ 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] Link to comment https://forums.phpfreaks.com/topic/29486-attention-never-solved-pattern/#findComment-139174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.