[Vim] Replace Footnote by Regular Expression
Replace footnote in reStructuredText format via regular expression in Vim editor.
(註1-1) => `` [1]_ ``
:%s/(註1-\(\d\{1}\))/ [\1]_ /gc
〔註1-1〕: => `` .. [1] ``
:%s/^〔註1-\(\d\{1}\)〕:/.. [\1] /gc
[001] => [001]_
:%s/\[\(\d\{3}\)\]/\[\1\]_/gc
001 => [001]_
:%s/\(\d\{3}\)/\[\1\]_/gc
:%s/\(0\d\{2}\)/\[\1\]_/gc
)[001]_ => ) [001]_
:%s/)\(\[\d\{3}]_\)/) \1/gc
〔註001〕 => `` .. [001] ``
:%s/^〔註\(0\d\{2}\)〕/.. [\1] /gc
Tested on Ubuntu Linux 15.10, vim 2:7.4.712-2ubuntu4.
References:
[1] |