Tuesday, January 25, 2011

Re: How to replace "\" to "\\"

Yes.The second is right.
 
first you must know \\ = \ in substitude and match.
 
like this :   \\\\ is match \\.  and  \\ is match \.
 
 
\%(\\\)\@<!\\\%(\\\)\@!
you can split it to three part :
 
 \%(\\\)\@<!   
  \\
  \%(\\\)\@!
it match "\",and this "\" havn't "\" before and follow it .
 
you can read the vim help.there are some examples.
:h :s
:h \@<!
:h \@!
 
 
 
2011-01-26

ifys0325
 

No comments: