문제

I would like to find number of match result with http://localhost:8080/MyProject/jsps/ErrorPage.jsp Incident ID in vi editor? How to do this?

i tried :%s/http://localhost:8080/MyProject/jsps/ErrorPage.jsp Incident ID/&/gn but it shows error E488: Trailing characters

도움이 되었습니까?

해결책

This is because you have the separator / in the word you are looking for, so that the blocks get confused.

You can escape all the /, but it can be faster and cleaner to change the separator. For example, you can use _:

:%s_http://localhost:8080/MyProject/jsps/ErrorPage.jsp_&_gn
   ^                                                  ^ ^

다른 팁

the syntax should be like below,

%s/http:\/\/localhost\:8080\/MyProject\/jsps\/ErrorPage.jsp\ Incident\ ID/&/gn

Note: you need to always scape "/, space"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top