modified valid term regex