2012-08-10 53 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

相關問題