Here we go...
I have a few stalwart regexes I have relied similar to:
So now I am handling funny french characters like this, and its job stopped.PHP Code:$str = "122 bc"; // letters or numbers space only
var_dump( preg_match("#^[a-z0-9 ]{3,20}$#i", $str) ) ;
//returns 1 as all is good
The encoding is utf-8 and the languages will be western european, so how do I do the equivalent of that regex i.e. how to filter in chars like é ?PHP Code:$str = "12é bc"; // letters or numbers space only
var_dump( preg_match("#^[a-z0-9 ]{3,20}$#i", $str) ) ;
//returns 0 - all is not good
I read this info that kyber kindly pointed me to, but the little pea in my head has stopped rolling round now I cannot clearly see how I check for a range of permitted chars in multi-byte character sets.
Starter for 10 for anyone?







Bookmarks