change regex matching to the whole markup rather than just var name