How to remove all links on a web page

Here is our goal in this session - we want to remove all "<A>...</A>" links on a web page by commenting them with "<!-- -->".

We now start a blank edit rules list and add several rules:

1. Find regular expression "<A[^>]*>(([^<]*)|(<IMG[^>]*>))</A>
Edit rule to find the links in a webpage
We search here for both the text and the image links and give it an individual names.

See also the Regular Expressions Syntax.

2. Compose the new text which will consist of a link enclosed in the comments:


See also the Format String Syntax.

3. Replace the links in file found on the first step with the text pieces that we have created:
Edit rule to replace links in file

4. Finally, save the file with the same name

Now the the Edit Rules window contains four rules:


Let's start the program now.
Click "Apply next rule" and the first rule will be executed.
The links found in the file appear in the Data View window and you can highlight it by double clicking the data piece:
Links found in the file

Click "Apply all rules" to execute all rules and examine the Data View:

All the links got commented and file saved. You can now click "Stop processing" to finish executing edit rules and all data pieces will disappear.

You can download the rules file here: edit rules.