A
A
Alex7773332022-02-26 12:22:48
Notepad++
Alex777333, 2022-02-26 12:22:48

How to replace parts of text in notepad++?

There is a large file where you need to correct two lines for products in a text editor.

Example:

<name>Матрас Dimax ОК Симпл Круглый диаметр 200 см</name>
<url>https://site.ru/matras-dimax-ok-simpl/xx/</url>


Need:
<name>Матрас Dimax ОК Симпл Круглый диаметр 200 см</name>
<url>https://site.ru/matras-dimax-ok-simpl/D-200/</url>


replacing /xx/ with /D-200/

To search for part of the text, I already found the solution -
200 см</name>
<url>.*?/xx/


But what to write notepad++ in Replace with? so that the text stays the same, but only /xx/ changes to /D-200/?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2022-02-26
@dodo512

Find: (?-s)(200 см</name>\R.*?/)xx/
Replace with: $1D-200/
https://regex101.com/r/PVGnVt/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question