introduce prefix matching

fixes #641