note 96479 modified in regexp.reference.unicode by danbrown
| From: | danbrown@php.net | Date: | Mon, 01 Mar 2010 15:57:53 +0000 |
| Subject: | note 96479 modified in regexp.reference.unicode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166484@lists.php.net to get a copy of this message | ||
these properties are usualy only available if PCRE is compiled with
"--enable-unicode-properties"
if you want to match any word but want to provide a fallback, you can do something like that:
<?php
if(@preg_match_all('/\p{L}+/u', $str, $arr) {
// fallback goes here
// for example just '/\w+/u' for a less acurate match
}
?>
--was--
these properties are usualy only available if PCRE is compiled with
"--enable-unicode-properties"
if you want to match any word but want to provide a fallback, you can do something like that:
if(@preg_match_all('/\p{L}+/u', $str, $arr) {
// fallback goes here
// for example just '/\w+/u' for a less acurate match
}
http://php.net/manual/en/regexp.reference.unicode.php