cnken / substitutions4nginx

Automatically exported from code.google.com/p/substitutions4nginx
3 stars 3 forks source link

正则替换的时候多行是不是无效啊 #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
想把里的js全部换掉, 这样写:
subs_filter <(script.*?)>[\s\S]*?<(\/script.*?)> "" gir;
只会替换在一行的,如果分行了就不会替换

Original issue reported on code.google.com by igaod...@gmail.com on 8 Oct 2011 at 7:10

GoogleCodeExporter commented 9 years ago
是的,为了效率的缘故,不支持多行

Original comment by nbubi...@gmail.com on 8 Oct 2011 at 7:12

GoogleCodeExporter commented 9 years ago
谢谢! 想知道有多行要替换有没有好的解决方案

Original comment by igaod...@gmail.com on 8 Oct 2011 at 7:15

GoogleCodeExporter commented 9 years ago
原版的Nginx替换模块可以,但是不支持正则,而且只能有一个
替换规则。

如果你有权限的话,可以在内容端就进行过滤。

Original comment by nbubi...@gmail.com on 8 Oct 2011 at 7:21

GoogleCodeExporter commented 9 years ago
原版的功能太弱了所以才安装这个模块, 
建议提供一个参数可以打开支持多行,毕竟有这需求人应该挺�
��的.

Original comment by igaod...@gmail.com on 8 Oct 2011 at 7:28

GoogleCodeExporter commented 9 years ago
如果支持多行匹配的话,就需要buffer住回复所有的内容,这��
�稍微繁忙一点的站点Nginx就吃不消了。

Original comment by nbubi...@gmail.com on 8 Oct 2011 at 7:31

GoogleCodeExporter commented 9 years ago
也是,性能影响应该会很大.谢谢了.

Original comment by igaod...@gmail.com on 8 Oct 2011 at 7:35

GoogleCodeExporter commented 9 years ago
希望能有個多行批配的開關選項,如果稍微繁忙的站長可以��
�啟cache功能,應該沒問題的

Original comment by bawbaw...@gmail.com on 27 Jul 2012 at 5:21

GoogleCodeExporter commented 9 years ago
恩,我会考虑在新的版本把这个功能加上。

Original comment by nbubi...@gmail.com on 27 Jul 2012 at 5:34