Unicode escape sequences in PHP?

View: New views
2 Messages — Rating Filter:   Alert me  

Unicode escape sequences in PHP?

by frank farmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all, I have a question regarding unicode character escape sequences:

I need to match char 0x2022 (bullet).

PHP's \x does not support multibyte chars.
PCRE (e.g. preg_match) supports \u2022, but only on platforms where the
PCRE lib has been compiled with a certain flag.

Is there an escape sequence I can use with mb_ereg that will match this
character?

Thanks,
Frank

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Unicode escape sequences in PHP?

by Tomas Kuliavas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Hi all, I have a question regarding unicode character escape sequences:
>
> I need to match char 0x2022 (bullet).
>
> PHP's \x does not support multibyte chars.
> PCRE (e.g. preg_match) supports \u2022, but only on platforms where the
> PCRE lib has been compiled with a certain flag.
>
> Is there an escape sequence I can use with mb_ereg that will match this
> character?
>
> Thanks,
> Frank

\xE2\x80\xA2 for text in UTF-8.

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php