Use regex to strip tagname rather than loop.