keun
keun

Reputation: 345

Notepad++ v4.2.2. regular expressions to match and replace all text between two tags

I have a large file with a lot of <h1></h1> tags with various text between it. I'm searching for a way to remove all text between those tags, which might also include newline chars.

Any help would be appreciated.

Update: Tried this, but doesn't work... (ofcourse cursor was at begin of file)

enter image description here

Upvotes: 3

Views: 4302

Answers (2)

Anirudha
Anirudha

Reputation: 32797

Select . matches new line and regular expression option

Find what:<h1>.*?</h1>

Replace with:<h1></h1>

Upvotes: 6

Sina Iravanian
Sina Iravanian

Reputation: 16286

find:

<h1>.*?</h1>

replace with:

<h1></h1>

Upvotes: 1

Related Questions