2012-08-10 48 views
0

我试图改变这些:此表达我创建有人可以检查看看我的表情有什么问题吗?

http://www.ltv.com/iloveu/health/contraceptionsurvey/

http://www.ltv.com/iloveu/health/contraception-special/

location ~* ^/iloveu/health/contraceptionsurvey/?$ { 
     rewrite^/ilo`enter code here`veu/health/ permanent; 
    } 

    location ~* ^/iloveu/health/contraception-special/?$ { 
     rewrite^/iloveu/health/ permanent; 

} 

%s/http:\/\/www\.ltv\.com\(.*\)/location ~\* \^\& \{ \r\t rewrite \^ \/iloveu\/health\/ permanent; \r }\r/g 

但似乎并没有被得到期望的输出。

回答

1
%s#http://www\.ltv\.com\(.*\)#location \~* ^\1?$ \{ \r\t rewrite^/iloveu/health/ permanent; \r }\r#g 

\&获得了整个字符串,这是匹配的,不只是在括号中的部分,你会得到与\1

相关问题