1

I have some HTML files. How can I remove all texts before and after class="header" or id="header" attribute. I want to extract all classes like it. For eg:

**These are my HTML codes:**

<div class="row">
<div class="header">
<div class="navigation">
<div class="container">
<div class="footer">

**I want to make abode HTML like:**

class="row"
class="header"
class="navigation"
class="container"
class="footer"

Here keeping my desired texts before and after, and removing all other texts. So what I can do? Anybody can help me.. ?

user2996362
  • 49
  • 1
  • 8
  • In visual code you can push alt and click on the lines you want to modify at the same time, in Notepad ++ I think it is called column select or something like that... – EdKenbers Jun 19 '20 at 06:04

2 Answers2

1

You could try the following find and replace, in regex mode:

Find:    <\S+ (class=".*?")>
Replace: $1

This would capture the class attribute along with its RHS value, and then replace with just this captured quantity.

Demo

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
0

Hold shift and alt and use the mouse to select a vertical portion of text. This will do the trick for the begining.

EdKenbers
  • 117
  • 11