Improve database title maker's regex, add unit tests

Improved RegExp aims to preserve the version number information in file
names. We also add a couple of tests to ensure proper behavior in
future.

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>