Saturday, July 31, 2010

回复: Searching for single character without anything around it , possible ?

vim regex is a little different.Try \<i\>

在 2010 年 7 31 日,4:34 下午,"Aaron Lewis" <aaron.lewis1989@gmail.com>编写:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
       I've remembered that some implementations of RegExp has a '\b' sign ,
e.g \bi\b means an character `i' without anything around it ,  does vim
support it ?

       :help regular-expression seems to have that expression , but no much
documents about it.

       Consider this:  int i = 0 ; i < numOfServ ; i ++
       And i'd like to replace the single `i' with j , so i tried s/\bi\b/j/g
, not working ? Or maybe something else , anyone could help ?

       Thanks in advance !

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxT3/wACgkQvf41sEptMqB/zACgw5o+ddyrH9so31APTpkm6z/5
nmoAoKY1g8RJiqnscx/Gd9cMfWGFJnWr
=UsVU
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment