in reply to pattern matching

It looks to me like you're trying to re-invent a source-code control system. If you really want to track revisions, you could do so without cluttering up your HTML documents by using a real system like CVS.