Comment on Nginx 1.0.0 is outComments−ez7715yA bit off topic, please consider the following example in [1]: if ($args ~ post=140){ rewrite ^ http://example.com/ permanent; } Why is "^" used as a regex wildcard instead of ".*"? Thanks![1] http://wiki.nginx.org/HttpRewriteModule−njs1234515yI think that regex matches any string as well - ^ simply matches the start of a line and all strings have a start.It might also be more performant because the regex engine doesn't consume the whole string before finding a match..−mnutt15yThat is exactly right. See "Taxing Rewrites" on http://wiki.nginx.org/Pitfalls−tedjdziuba15yIn Soviet Russia, regex starts you.
Comments
A bit off topic, please consider the following example in [1]:
Why is "^" used as a regex wildcard instead of ".*"? Thanks![1] http://wiki.nginx.org/HttpRewriteModule
I think that regex matches any string as well - ^ simply matches the start of a line and all strings have a start.
It might also be more performant because the regex engine doesn't consume the whole string before finding a match..
That is exactly right. See "Taxing Rewrites" on http://wiki.nginx.org/Pitfalls
In Soviet Russia, regex starts you.