created a dynamic regex based on the tags to prevent removing unfound tags