Convert webpage any textual instance that matches regex, to a hyperlink

I want to make a plugin that parses every HTML page, looking for text that matches RegEx ID(?:\.\d{4}){4}.

So that this, for example:
<p>Hello, the ID of your thing is ID.1234.1234.1234 thank you come again</p>

Gets converted to this:
<p>Hello, the ID of your thing is <a href="">ID.1234.1234.1234</a> thank you come again</p>

To match your example, perhaps:


I’m not an expert on RegEx but I use some code that can match a regex in a text node and surround it with tags for formatting purposes. I suspect you could re-purpose that to create a link.

Check out the function THmo_doHighlight() in this userscript:

(Adapted from )

You could create a userscript as a proof of concept, and migrate the working code to a content script in an extension.