Added option to use regexp for DB filename