У меня есть много ссылок, содержащихся в файлах .html и .txt, которые я хотел бы изменить.В основном я использую Kate в качестве текстового редактора, поэтому я задал этот вопрос с тегом kate
.Ниже приведен пример ссылок:
<li>
<a href="http://sk1project.org/">
sK1
</a> is an open source vector graphics editor similar to CorelDRAW, Adobe Illustrator, or Freehand. First of all sK1 is oriented for PostScript processing. UniConvertor is a universal vector graphics translator. It uses sK1 engine to convert
one format to another. Development of the import/export modules for this program goes through different stages, quality and feature coverage are different among formats.
</li>
<li>
<a href="http://tango.freedesktop.org/Tango_Desktop_Project">
The Tango Desktop Project
</a> exists to help create a consistent graphical user interface experience for free and Open Source software. While the look and feel of an application is determined by many individual components, some organization is necessary in order to
unify the appearance and structure of individual icon sets used within those components. The Tango Desktop Project defines an icon style guideline to which artists and designers can adhere. A sample implementation of the style is available as an icon
theme based upon a standardized icon naming specification. In addition, the project provides transitional utilities to assist in creating icon themes for existing desktop environments, such as GNOME and KDE.
</li>
Я нашел Регулярное выражение для извлечения URL из HTML-ссылки |Python - Регулярное выражение для извлечения URL из ссылки HTML - Переполнение стека, поэтому я знаю, как захватить текст из href в ">, используя href=[\'"]?([^\'" >]+">)
, но я не знаю, как сохранить текст из href в" до> и добавьте следующий текст: 'rel = "nofollow noopener noreferrer">'.
У меня есть то, как конечный результат должен выглядеть ниже:
<li>
<a href="http://sk1project.org/" rel="nofollow noopener noreferrer">
sK1
</a> is an open source vector graphics editor similar to CorelDRAW, Adobe Illustrator, or Freehand. First of all sK1 is oriented for PostScript processing. UniConvertor is a universal vector graphics translator. It uses sK1 engine to convert
one format to another. Development of the import/export modules for this program goes through different stages, quality and feature coverage are different among formats.
</li>
<li>
<a href="http://tango.freedesktop.org/Tango_Desktop_Project" rel="nofollow noopener noreferrer">
The Tango Desktop Project
</a> exists to help create a consistent graphical user interface experience for free and Open Source software. While the look and feel of an application is determined by many individual components, some organization is necessary in order to
unify the appearance and structure of individual icon sets used within those components. The Tango Desktop Project defines an icon style guideline to which artists and designers can adhere. A sample implementation of the style is available as an icon
theme based upon a standardized icon naming specification. In addition, the project provides transitional utilities to assist in creating icon themes for existing desktop environments, such as GNOME and KDE
</li>
Как это можно сделать с помощью регулярных выражений в Kate?
Спасибо.