PCRE has very good utf-8 support. Simply add the /u modifier to your pattern.
preg_match('/non-utf-8 matching pattern/', $string);
preg_match('/utf-8 matching pattern/u', $string);
Regular Expression (POSIX Extended)
- Introduzione
- Installazione/Configurazione
- Costanti predefinite
- Esempi
- POSIX Regex Funzioni
- ereg_replace — Sostituzioni con espressioni regolari
- ereg — Riconoscimento di espressione regolare
- eregi_replace — Sostituzioni con espressioni regolari senza distinzione tra maiuscole e minuscole
- eregi — Riconoscimento di espressioni regolari senza distinzione tra maiuscole e minuscole
- split — Suddivide una stringa in una matrice utilizzando le espressioni regolari
- spliti — Suddivide una stringa in una matrice usando le espressioni regolari senza distinguere tra maiuscole e minuscole
- sql_regcase — Genera una espressione regolare per riconoscimenti senza distinguere tra maiuscole e minuscole
Daniel Klein ¶
1 year ago
Ray dot Paseur at Gmail dot com ¶
1 year ago
The POSIX functions are deprecated. Instead of the "ereg" collection you want to use something from the PCRE world.
http://www.php.net/manual/en/book.pcre.php
arekm ¶
1 year ago
If you switch to PCRE world functions note that pcre doesn't support UTF-8 well.
There are limitations - read "POSIX CHARACTER CLASSES" or "UNICODE CHARACTER PROPERTY SUPPORT" chapter at http://www.pcre.org/pcre.txt.
