Search code examples
javascriptregexpcre

How to convert JavaScript Unicode range regex into PHP PCRE?


I have this regex range for Latin being used in JavaScript

[\u0000-\u007F]

and want to convert it into PHP PCRE but it tells me \u This token is not supported while I just want to use the range of Unicodes


Solution

  • PCRE does not support the \uFFFF syntax instead it uses \x{FFFF}. For example:

    [\x{0000}-\x{007F}]