How to do substitions (like perl s/// operator) in rewrites?

bartschipper nginx-forum at nginx.us
Mon Jan 11 11:28:43 MSK 2010


Thank you for your responses!

I think Maxim is right and embedded Perl is the way to go.

Bernd's idea would work if there was an easy way to generate a map file with hyphens from the source file.
However the source file has 200k+ entries that look like this:

thisisthebestnewsever                            123456;
expertsadvicetoeatmorefish                       123457;
...

I can not think of an automated way to convert this to:

this-is-the-best-news-ever                       123456;
thisisthebestnewsever                            123456;
experts-advice-to-eat-more-fish                  123457;
expertsadvicetoeatmorefish                       123457;
...

Knowing that the map module is case-insensitive may safe me from confusion in the future.

Thanks again,
Bart

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,39425,39666#msg-39666




More information about the nginx mailing list