Find and Replace in HTML6 Editor

Easily set up find-and-replace 🔄 rules, decide where they should apply, and run them individually or all at once.

By default, the editor starts with one replace rule, but you can add more using the plus icon +. Need to remove a rule? Just click the recycle bin icon.

ℹ️ This video was recorded before the rebranding, when the editor was called HTMLg. The main features, however, remain the same!

Click the main Replace button to apply all rules at once, or use the triangle icons to execute them one by one.

Find and Replace

HTML is built using elements, which consist of different parts working together. When regular expressions are disabled, you can choose where to apply replacements in the dropdowns:

html tag attribute content

  1. Everywhere in the document
  2. Only in the visible content (as seen in the visual editor)
  3. In tag attributes
  4. In class and ID names
  5. In inline styles

Examples:

Find: <a href="http
Replace with: <a target="_blank" rel="nofollow" href="http
Makes external links nofollow and opens them in a new browser tab. Swap the input fields to remove this behaviour from links.

Find: style="text-align: center"
Replace with: class="aligncenter"
Replaces inline styles with classes.

Regular Expressions

Want more advanced searches? Enable regular expressions by checking the box next to the main Replace button.

RegEx Examples

\n – New line
. – Any character
\d – A single digit
\d{2} – A two-digit number
\w – Any word character
\s – Any whitespace character, including spaces, tabs, and line breaks
<span\b[^>]*>(.*?)</span> – Matches everything inside <span> tags. Example: <span style="color: #f00;">text</span>
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b – Matches an IP address (four groups of 1-3 digits separated by dots). Example: 23.243.2.34

For more details and examples, check out this regex generator.

Helpful Tips

  • Click the undo button below the source editor to revert the document to its state before executing the find and replace..
  • Use regular expressions carefully, especially with wildcards, to avoid unexpected replacements.
  • To replace special characters like < or & escape them in your regex patterns.

With these features and tips, you’ll be able to clean up and edit your HTML content quickly and efficiently!