only preform regex check if it is definde