PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, July 26, 2022

[FIXED] How can I extract specific texts from an HTML file by using Notepad++ or Adobe Dreamweaver?

 July 26, 2022     data-entry, dreamweaver, html, notepad++, ocr     No comments   

Issue

.

I want to extract the ID attribute from an HTML file by using Notepad++ or Dreamweaver. Delete all other texts.

For Eg:

<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">

I want to extract only ID attribute from HTML like this;

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

So what I can do? Please help me..

.


Solution

  • Ctrl+H
  • Find what: <\w+[^>]+(id=".+?").*?>
  • Replace with: $1
  • CHECK Wrap around
  • CHECK Regular expression
  • Replace all

Explanation:

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

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here



Answered By - Toto
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing