VS Code multiline search and replace for HTML / XM

2020-07-18 03:48发布

How to search for a start and ending tag that may include multiple non-blank lines?

<body myattr="hello" >
  <title>Hello</title>
</body>

<element>Surprise!!!</element>

<body myattr="goodbye" >
  <title>Goodbye</title>
</body>

1条回答
放荡不羁爱自由
2楼-- · 2020-07-18 04:28

Answer kindly provided to me by VS Code developer. May it help others.

Thank you @roblourens!

<body[\n\s\S]*?</body>

This is useful to replace or delete unwanted elements in XML or HTML.

查看更多
登录 后发表回答