fix regex validation to accept '^~