a newbie question regarding regex in nginx conf

Zhang Yining zhang.yining at gmail.com
Wed Sep 3 20:42:01 MSD 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Maxim,

Thanks for the prompt reply!

Maxim Dounin wrote:
>>
>> So is there any way to use curly braces in regex? If so, could some one
>> kind enough to provide a link or short explanation of how to do it?
> 
> Just quote the regex, i.e:
> 
> rewrite  "([0-9]{2})([0-9]{2})([0-9]{2})" 
> /path/to/photos/$1/$1$2/$1$2$3.png;
> 
> (single quotes will do the trick too).

Ah I see! Why didn't I think of trying that before posting the question?

> 
> It's documented in
> http://sysoev.ru/nginx/docs/http/ngx_http_rewrite_module.html#rewrite
> (in russian), but not (yet) in english wiki.  Feel free to update
> http://wiki.codemongers.com/NginxHttpRewriteModule#rewrite.
> 

Done.

> Maxim Dounin
> 
> 

- --
Zhang Yining
URL:         http://www.zhangyining.net | http://www.yining.org
mailto:      yining at zhangyining.net | zhang.yining at gmail.com
Fingerprint: 25C8 47AE 30D5 4C0D A4BB  8CF2 3C2D 585F A905 F033
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIvr5XPC1YX6kF8DMRAupRAJwJyK4VHjux1Pc9tjA38vx58AfOSACeJBxr
sxQG4vj7bPv+Q1mQbOWmot4=
=jy7G
-----END PGP SIGNATURE-----





More information about the nginx mailing list