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. Quote 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\ŝ\ĉ\ĝ\ĵ\ŭ\ĥ\Ŝ\Ĉ\Ĝ\Ĵ\Ŭ\Ĥ] Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.