problem with PCRE matching, utf-8, Greek, rewrite

Maxim Dounin mdounin at mdounin.ru
Sat Sep 25 13:17:38 MSD 2010


Hello!

On Sat, Sep 25, 2010 at 11:43:48AM +1000, mat h wrote:

> When attempting to use *UTF8 I always receive.
> [emerg]: pcre_compile() failed: (*VERB) not recognized in
> "(*UTF8)^/([^/^.]+)(?:/?)(?:index([0-9]*)\.html?)?$" at
> "8)^/([^/^.]+)(?:/?)(?:index([0-9]*)\.html?)?$" in
> /etc/nginx/sites-enabled/nexusddl.com:85
> 
> Yet my PCRE has UTF-8 support, tested it in PHP (both nginx and php
> compiled against PCRElib included in debian)

You need at least pcre 7.9 for (*UTF8) support.

http://www.pcre.org/changelog.txt

[...]

> >                        if ($request_uri ~ "(*UTF8)^(.*)[\\?|&]filename=([%
> > ,a-zA-Z0-9\x{386}-\x{3ff}_\-\.]+)(&.*)?$") {
> >                                set $fn $2;
> >                        }

Note that (*UTF8) is meaningless here as $request_uri doesn't 
contain utf-8 characters, it's urlencoded.

Maxim Dounin



More information about the nginx mailing list