简体   繁体   English

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

[英]Notepad++ regex replace named groups

I try replace author Full name with article title I have a list of articles, similar like this: 我尝试替换作者全名与文章标题我有一个文章列表,类似这样:

  1. Albershein P., Nevis DJ A method for analysis of sugars in plant cell wall polysaccharides by gasliquid chromatography // J. Carbohydrate Research. Albershein P.,Nevis DJ一种通过气液色谱法分析植物细胞壁多糖中糖的方法// J.碳水化合物研究。 – 1967. – Vol. - 1967年。 - Vol。 5, № 3. – Р. 5,№3。 - Р。 340–345. 340-345。

And I have Regex for it 我有正则表达式

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

but replace like 但取而代之的是

\k{n1} 

or 要么

\k'n1'

doesnt work 不起作用

we try this in perl but have the same result 我们在perl中尝试这个但是有相同的结果

Try using in regex (?<groupname>something to match) 尝试使用正则表达式(?<groupname>something to match)

And in replacement: $+{groupname} 替换: $+{groupname}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM