diff options
author | mat tso <mat-tso@topmail.ie> | 2014-03-08 23:39:34 +0100 |
---|---|---|
committer | mat tso <mat-tso@topmail.ie> | 2014-03-09 00:18:17 +0100 |
commit | ed295020ae557161868208fe443fd7e6089639aa (patch) | |
tree | f184e2f6db432fb620fe9f44562118ed4306c6f8 /doc/easytags.txt | |
parent | 9713f0a284921dc9782ae1c24dae03ce0c3f9901 (diff) | |
download | vim-easytags-ed295020ae557161868208fe443fd7e6089639aa.tar.gz |
Replace \0 by \g<0> in python sub
> The back reference \g<0> substitutes in the entire substring
> matched by the RE.
> http://docs.python.org/2/library/re.html#re.sub
The documentation does not mention \0 as an alias to it.
Although \1 to \9 works.
I guess this alias (\0 <=> \g<0>) existed in old python version,
but it is not the case any more.
In python 2.7 and 3.3:
> import re; re.compile(r'123').sub(r'@\0@',"ab123cd")
'ab@\x00@cd' # KO
> import re; re.compile(r'123').sub(r'@\g<0>@',"ab123cd")
'ab@123@cd' # OK
Diffstat (limited to 'doc/easytags.txt')
0 files changed, 0 insertions, 0 deletions