Possible Duplicate:
php – regular expression – PCRE does not support \L, \l, \N, \P,
i have a function
public function valid_city_state($data)
{
$data = trim($data);
if(!$data)
{
return TRUE;
}
$valid = preg_match("/^[a-zA-Z\u0080-\u024F\s\/\-\)\(\`\.\"\']+$/",trim($data));
if(!$valid)
{
$this->form_validation->set_message('valid_city_state', 'Please enter a valid %s.');
return FALSE;
}
else
{
return TRUE;
}
}
it has regular expression
$valid = preg_match("/^[a-zA-Z\u0080-\u024F\s\/\-\)\(\`\.\"\']+$/",trim($data));
when executing it , it gives the following error
A PHP Error was encountered
Severity: Warning
Message: preg_match() [function.preg-match]: Compilation failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 9
Filename: home/auth.php
Line Number: 1632
looked at some examples but could not get what is needed
php – regular expression – PCRE does not support \L, \l, \N, \P,
http://www.sitepoint.com/forums/showthread.php?748713-Preg-match-with-php-PCRE-error
please help . thanks in advance .
UPDATE
this regular expresson works fine in javascript
Switch the
us forxs and wrap the hex in braces like{0080}, also add a trailinguflag.