[ticket/11288] add test cases for search

Adds test cases for search backends.
Fix regex in Postgres
http://tracker.phpbb.com/browse/PHPBB3-11288