in reply to regex with variable input

BioGeek, I don't mean to complain, but can simplify your question, a bit, get it down to the basics (I don't want to try to figure out all that HTML). Also, consider <readmore> tags if posting long questions. Thanks, and I look forward to seeing a distilled version.

Update: Escaped my angle brackets per hv

"Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton