Eathen Nutt
Eathen Nutt

Reputation: 1473

PCRE: pattern for unicode characters (hex code)

What is the PCRE pattern, in PHP, for characters with hex code from \x00 to \xFF?

Upvotes: 0

Views: 619

Answers (1)

silkfire
silkfire

Reputation: 25965

To match a specific Unicode code point, use \uFFFF where FFFF is the hexadecimal number of the code point you want to match. You must always specify 4 hexadecimal digits. E.g. \u00E0 matches "à", but only when encoded as a single code point U+00E0.

Source: Regex Tutorial

Upvotes: 1

Related Questions