Changed regex to the variable instead for tag check