using regex to extract rather than adding a hidden div