leke Posted April 12, 2011 Share Posted April 12, 2011 preg_match_all('/[\w\ŝ\ĉ\ĝ\ĵ\ŭ\ĥ\Ŝ\Ĉ\Ĝ\Ĵ\Ŭ\Ĥ]+|[\W]/', $form_submission, $matches); // $matches[0] array returns words that include accented characters. foreach ($matches[0] as $value){ if (preg_match('/\W/', $value)){ // check for any non-wordy characters in array. ... I'm checking for a word which might include a character like ŝ ĉ ĝ ĵ ŭ ĥ Ŝ Ĉ Ĝ Ĵ Ŭ Ĥ. This part of the code preg_match('/\W/', $value) is identifying one of the accented characters as a non-standard character and returning true. How could I make a match for '/\W/' but exclude ŝ ĉ ĝ ĵ ŭ ĥ Ŝ Ĉ Ĝ Ĵ Ŭ Ĥ ? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/233531-how-to-get-accented-characters-identified-as-wordy-characters/ Share on other sites More sharing options...
sasa Posted April 14, 2011 Share Posted April 14, 2011 [^\w\ŝ\ĉ\ĝ\ĵ\ŭ\ĥ\Ŝ\Ĉ\Ĝ\Ĵ\Ŭ\Ĥ] Link to comment https://forums.phpfreaks.com/topic/233531-how-to-get-accented-characters-identified-as-wordy-characters/#findComment-1201554 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.