Using regex instead of 2 grep commands to match database name

Change-Id: I62dac4d4de6b859d2f54d158ce307385ff42ebaf