Recognize autocompleted commands

When a command is autocompleted with jline, it adds a space.
When checking for commands this space was left out.
Now using regex it will work.