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

In reply to Re: regex with variable input by bradcathey
in thread regex with variable input by BioGeek

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":