Switch the regex checking after the initial terminal to use *, so if there's nothing after the terminal, that's okay