Jump to content

How to get accented characters identified as wordy characters(?)


leke

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.