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="https://domain.com/ID.1234.1234.1234">ID.1234.1234.1234</a> thank you come again</p>
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: