Jump to content

Regular expressions - accents


quimkaos

Recommended Posts

it's not working since i want to use eregi that gives me a boolean type unser.

what i'm doing:

 

$fooo = "áà êaaa âotre";
if (!eregi ('/\p{L}/', $foo)){  //ask if $foo uses those chars. a-zA-Z (eregi is case insensitive anyway) and accents like à é ã. simply not numbers
$erro ++; // adds +1 to an variable (error)
$foo ="<font color='red'>".$foo." - formato do nome é inválido, por favor use um nome válido!</font>"; // makes foo display it's error
echo ($nome."</br>"); //...
}

Is there any reason you need to use eregi? The preg_* functions are often faster, and you can supply an "i" modifier to make them case insensitive.

 

If you insist on ereg, I think the only way you can achieve this is by changing your locale. See setlocale.

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.