-1

In a html file I want to replace

<div id="pe1" style="display:none">
<div id="pe2" style="display:none">
....
<div id="pe20" style="display:none">

with

<div id="pe1" style="border:2px solid black">
...
<div id="pe2" style="border:2px solid black">
<div id="pe20" style="border:2px solid black">

How to do it?

1 Answer 1

0

Use the replace dialog with those parameters:

Select "Regular expressions" in the "search mode" box.

Search what: <div id="pe(\d+)" style="display:none">

Replace with: <div id="pe\1" style="border:2px solid black">

The parenthesis in the search expression allow you to use the \1 in the replace (the parenthesis define a capturing group, and \1 refers to the first one), and \d+ stands for "one or more digits".

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .