LegolasKiss wrote: > Hi every one. > When i use printf to print the time, i use ``%6d'' instead of ``%06d'' > in code: > printf( "%d.%6d", time_t.second, time_t.milsecond); > > so the log is like this now: > > time cost is 3. 1234 > time cost is 3. 234 > time cost is 3. 5 > ..... > > i want to use the regular expression in vim to change all spaces into > ``0'',but i can't do this in one operation. > > my way is like this: > <esc>:%s/\(\d\.\ *\)\ /\10/g > 6g&
Many ways... One is something like this :%s/\d\. */\=tr(submatch(0)," ","0") See :help :s\= :help tr() :help submatch() Ben. Send instant messages to your online friends http://au.messenger.yahoo.com --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---