Remove all HTML attributes

Asked

Viewed 181 times

-1

I have a file of approximately 60000 lines and need to remove all attributes from the HTML file.

Do you know the name of an application, Notepad plugin or any way to carry out this process in an automated way? Thanks in advance!

Exemplo:
<td height="20" align="left"><font color="#000000">Abono</font></td>

COMO DEVERIA FICAR:
<td >Abono</td>
  • To make it clear, what you mean by HTML attribute?

  • With regular expression you should get. string+=+"+tudo que vier depois das aspas+" replaced by ' '

1 answer

1

Use that regular expression

<.*?>|</.*?>

And replace it with "nothing" Same in the image below Squeeze Ctrl + f to open the dialog

inserir a descrição da imagem aqui

Note: Remember to mark down the field "regular expression"

Edit 1 * How you reported in the comment to remove tag attributes Use expression

<([a-z]+) .*?=".*?( *\/?>)

and replace with

<\1$2

inserir a descrição da imagem aqui

See working here

Watch out if you’re using single quotes ' subsititua no regex double quotes

Sources https://stackoverflow.com/questions/33066103/notepad-regular-expression-to-remove-html-tag-containing-embedded-tags

  • @Marcos.Brinner, thanks for your help! I edited my question to have the exact example of what I need. Can you help me better? I’m sorry I didn’t ask the question correctly!

  • I made a change in the answer see

  • @Marcos.Brinner, the <font> </font> tag still persists. ?

  • was just these font tags ? just sub-tweet them in that same location, but mark the opiation "normal" below

Browser other questions tagged

You are not signed in. Login or sign up in order to post.