A
A
Alex Goncharov2017-10-27 12:25:44
Regular Expressions
Alex Goncharov, 2017-10-27 12:25:44

How to replace the content of all links in files containing specific text?

There is a folder with web pages, inside them there are links like:

<a href="link1.html#popup-login"></a>
<a href="link2.html#popup-reg"></a>
<a href="link3.html#popup-reg"></a>
<a href="link4.html#popup-login"></a>
<a href="link5.html#popup-reg"></a>

How can I use Sublime Text 3 or Notepad++ to replace all links in all files with another if they contain "#popup"?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
spike__x, 2017-10-27
@spike__x

In notepad ++, press the replace button .. select the find in files tab.
Select the folder where all files
are located.
Paste in the find field <a href=".*#popup.*>
In the replace with field, write how the link should look like, for example <a href="link5.html#id"></a>
, click replace in files and click ok

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question