bugfix + added tests for regex search

Signed-off-by: Wouter Vroege <wouter@woutervroege.nl>