Ok, I'm a big enough man to admit when I'm wrong.
After reading the POSIX specification for alphanumeric characters and
realizing that it accomodates for different character set collations,
I concede that you are correct in stating that 'alphanumeric' should
apply to accented characters.

However, the fact that English is not the most spoken language in the
world is a vacuous argument; by your reasoning, programming languages
should be written and interpreted in Chinese and Spanish instead of
English.  I have yet to find a compiled or interpreted Chinese
programming language, and I don't think they exist AFAIK.
English is ubiquitous in the scientific (and software) community, and
there's not much we can do to change this (my first language is
French), nor would I want to.


Anyways, here's what I've found:

After doing a bit of research, I believe the solution to your problem
is this regular expression:  /[^[:alnum:]]/u

Ex:

//1st element will pass, 2nd ?, 3rd will fail
$data = array("asdf1", "çñasd45", "@#%asd23");

foreach ($data as $str):
        if (!preg_match("/[^[:alnum:]]/u", $str)) echo $str . " is
valid alphanumeric. \n\n"';
        else echo $str . " IS NOT VALID\n\n";
endforeach;

print_r($data);

//Output:

asdf1 is valid alphanumeric.

çñasd45 is valid alphanumeric.

@[EMAIL PROTECTED] IS NOT VALID

Array
(
    [0] => asdf1
    [1] => çñasd45
    [2] => @#%asd23
)


On Jun 2, 4:56 am, leo <[EMAIL PROTECTED]> wrote:
> I did click the link and I followed the references. It would seem that
> a letter like ñ or ç is a letter embellished with a diacritic.
> Therefore the letter is valid and the diacritic should be ignored. Ñ
> is alpha.
>
> From the same source, Spanish is spoken as a first language by between
> 322 and 400 million people. English by 375 million. The English
> speaking population of the USA is 215 million. Furthermore, Spanish is
> a Latin language and the ASCII definition is based on the Latin
> alphabet.
>
> > >http://en.wikipedia.org/wiki/Alphanumeric
>
> Things have moved on from the World as defined by IBM et al
> (thankfully), but unfortunately the World has now become defined, in
> the eyes of many, by Wikipaedia. Wikipaedia is a useful tool used in
> conjunction with others, but dangerous on its own.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to