regex - Notepad++正则表达式替换命名组

标签 regex perl notepad++ regex-group named

我尝试用文章标题替换作者全名
我有一个类似的文章列表:

  1. Albershein P., Nevis D. J. A method for analysis of sugars in plant cell wall polysaccharides by gasliquid chromatography // J. Carbohydrate Research. – 1967. – Vol. 5, № 3. – Р. 340–345.


我有正则表达式
(?'n1'^\d{3}\. )(?'n2'(?:(?:[A-ZА-Я][-a-zćа-я ]+)?([A-ZА-Я][-a-zćа-я]+\xA0[A-ZА-Я]\.(?:\xA0[A-ZА-Я]\.){0,2}\,?)(?: \[et al\])? ?)+)(?'n3' [^\/]+[\/]{2})

但是像这样替换
\k{n1} 

或者
\k'n1'

不起作用

我们在perl中尝试此方法,但结果相同

最佳答案

尝试在正则表达式(?<groupname>something to match)中使用

并替换为:$+{groupname}

关于regex - Notepad++正则表达式替换命名组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33633091/

相关文章:

regex - Notepad++ 可以将搜索结果保存到文本文件吗?

notepad++ - Split View以在 Notepad++ 中打开 2 个以上的实例

javascript - 使用正则表达式删除前导空格、回车符和不需要的标签

php - 将 **Foo** 替换为 <strong>Foo</stong> (正则表达式)?

perl - 在 Perl 中使用 OLE 遍历 Outlook 文件夹

regex - Eclipse 或 Notepad++ 中区分大小写的字符串替换

python - 在 python 中使用正则表达式拆分带括号的字符串

python - 对多行使用正则表达式

perl - 无法在 Perl 中使用 qx 从提示行完成命令

arrays - 从数组创建散列的多维键?