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
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
Nico Weber wrote:
I have never invoke functions in the ``esc:s/'' before.
If I understand you correctly, \zs might be even easier in this context:
:%s/d\.%\zs/0/g
See `:h \zs`.
You seem to have muddled that a bit...you have 'd' where you surely want '\d'
and
I'm not sure what
LegolasKiss wrote:
[...]
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\.\ *\)\
On 3月9日, 下午10时51分, A.Politz [EMAIL PROTECTED] wrote:
LegolasKiss wrote:
[...]
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
:s/\v(\d\.\s*)@=\s/0/g
This does work.
Nice, AP. I had believed (I thought on the basis of having run some tests...)
that
\zs was just syntactic sugar for \@= and that they thus behaved the same way,
so
didn't even try it, though I thought of it. Obviously I was wrong!
There may be many