Interactive regular expression sandpit

Put an HTML tag in the tag box and a regular expression in the regexp box. The result of tagging each matching substring with the given tag will be rendered on the right-hand side of the page, whenever you change the tag or regexp, so long as the regexp is well-formed.
When you are happy, click the button to insert your tags into the source text ­ then you can continue to add further tags.

tag regexp
The most-recent rendering appears below:

It is useful to use b as the tag to see the selected substrings, then change to an appropriate tag for markup before using tag TEXT.
For this example, [A-Z][A-Z][A-Z]* selects the title, which we can tag with h1; \(.*\) selects the attribution, which we can tag with i.
Use regular expressions to tag the lines and verses so that the poem is rendered appropriately.