One of my favorite Windows based text editors is EditPlus (see https://editplus.com/ for more details). I have been using it for quite a while. I like using it to “clean” chunks of text from the code page in WordPress posts. On occasion, a lot of additional, unnecessary junk codes from word processors can end up being inserted into posts. In some cases, this can wreak havoc on the page outputs. Such havoc can be difficult to troubleshoot. So the EditPlus format syntax is important for helping clean up my HTML code.
Cleaning up EditPlus Format Syntax
The output on this will save me tons of time when processing code for my various WordPress posts.
So this is another great use for ChatGPT 5.2. Here is the chat below, starting with my prompt:
I am using EditPlus to try to clean up some coding on a WordPress page. The HTML content is full of items like these:
<p data-start=”822″ data-end=”841″>
(Where the quoted numbers vary on each line they appear)
and these:
<li data-start=”842″ data-end=”882″>
and these:
<strong data-start=”953″ data-end=”981″>
and these:
<ol data-start=”984″ data-end=”1345″>I believe I need to clean up the code so every occurrence of:
‘ data-start=”984″ data-end=”1345″‘
is deleted.Is there a search and replace way to do this in EditPlus? Even if I have to do it 3 times due to the possible different sizes of the quoted numbers that would be easier than going through hundreds of lines of code.
Yes. This is exactly what regular expression search & replace is for, and EditPlus can do it cleanly in one pass.
You do not need to do this three times.
The Goal (restated clearly)
You want to remove every occurrence of this pattern:
data-start="NUMBER" data-end="NUMBER"
…where the numbers vary in length, and leave the HTML tags intact.
Example input:
<p data-start="822" data-end="841">
<li data-start="842" data-end="882">
<strong data-start="953" data-end="981">
<ol data-start="984" data-end="1345">
Desired output:
<p>
<li>
<strong>
<ol>
✅ The Correct EditPlus Solution (One Pass)
1. Open Search → Replace (Ctrl + H)
2. Enable Regular expression
Check the box labeled:
☑ Regular expression
3. Use THIS Find pattern
\sdata-start="\d+"\sdata-end="\d+"
What this does
\s→ leading space (prevents breaking the tag)data-start="→ literal match\d+→ any number of digits" data-end="→ literal\d+→ any number of digits"→ closing quote
This safely matches only the unwanted attributes.
4. Replace with (leave EMPTY)
[leave blank]
5. Click Replace All
Done. Hundreds of lines cleaned instantly.
🔍 Optional: Preview First (Recommended)
Before Replace All:
- Click Find Next
- Verify it highlights exactly what you want removed
❌ Do NOT use these weaker methods
Avoid:
- Searching for fixed numbers
- Multiple passes
- Manual deletion
- Searching for
data-start=alone (could leave broken spacing)
🧠 Why this is safe for WordPress
- Does not alter tag names
- Does not touch attributes other than the two specified
- Preserves valid HTML
- Works regardless of number size
If you want, I can also give you:
- A backup-safe variant
- A version that handles reversed attribute order
- A macro version for reuse
- Or a cleanup regex for other AI-generated HTML junk
Just say the word.