Posted by Chung Leong on 11/18/05 21:02
Ewoud Dronkert wrote:
> Chung Leong wrote:
> > echo preg_match('/./u', $text);
>
> That will match on any single utf8 character, which could potentially be
> followed by non-utf8 data... Also, I'm not sure about its behaviour when
> encountering such data.
>
> --
> E. Dronkert
PCRE validates the string before it runs the expression.
pcre.c:8037
if (valid_utf8((uschar *)subject, length) >= 0)
return PCRE_ERROR_BADUTF8;
If it isn't valid all the way through, then there's no match.
[Back to original message]
|