【问题标题】:How can I extract specific texts from an HTML file by using Notepad++ or Adobe Dreamweaver?如何使用 Notepad++ 或 Adob​​e Dreamweaver 从 HTML 文件中提取特定文本?
【发布时间】:2023-03-12 11:02:01
【问题描述】:

.

我想使用 Notepad++ 或 Dreamweaver 从 HTML 文件中提取 ID 属性。删除所有其他文本。

例如:

<div id="header" class="header-blue sticky">
<div id="header-message" class="alert alert-dismissible">
<form id="contact-form" class="custom-form" method="POST" action="https://www.google.com">
<input id="your-email" type="email" class="form-email"  placeholder="Your Email">

我只想像这样从 HTML 中提取 ID 属性;

id="header"
id="header-message"
id="contact-form"
id="your-email"

那我能做什么?请帮帮我..

.

【问题讨论】:

  • 到目前为止你有什么尝试?
  • 我在 google 中搜索了一个工具网站。但我没有得到任何网站。 :( :(

标签: html notepad++ ocr dreamweaver data-entry


【解决方案1】:
  • Ctrl+H
  • 查找内容:&lt;\w+[^&gt;]+(id=".+?").*?&gt;
  • 替换为:$1
  • 检查 环绕
  • CHECK 正则表达式
  • 全部替换

说明:

<\w+            # opening tag
[^>]+           # 1 or more not >
(id=".+?")      # group 1, id and value
.*?             # 1 or more any character, not greedy
>               # close tag
  

屏幕截图(之前):

截图(之后):

【讨论】:

  • 哇...它成功了..你很聪明。我无法用言语来表达我的幸福..非常非常感谢..谢谢..谢谢..:) :)
猜你喜欢
  • 2011-01-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多