Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

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

like image 392
Victor Dronov Avatar asked Nov 10 '15 15:11

Victor Dronov


People also ask

How do you replace RegEx in Notepad?

A normal “Find and Replace” can't do that, but it's possible with “Regular Expressions”. In Notepad++ press Ctr+H to open the “Find and Replace” window. Under Search Mode: choose “Regular expression” and then check the “matches newline” checkbox.

Can I use RegEx in Notepad?

Using Regex to find and replace text in Notepad++ In all examples, use select Find and Replace (Ctrl + H) to replace all the matches with the desired string or (no string). And also ensure the 'Regular expression' radio button is set.

What is a capturing group RegEx?

Capturing groups are a way to treat multiple characters as a single unit. They are created by placing the characters to be grouped inside a set of parentheses. For example, the regular expression (dog) creates a single group containing the letters "d" "o" and "g" .


1 Answers

Try using in regex (?<groupname>something to match)

And in replacement: $+{groupname}

like image 160
Jakub Binkowski Avatar answered Oct 02 '22 04:10

Jakub Binkowski