The documentation for only_db still mentions that mysql LIKE wildcards are accepted, but using them fails to display properly in the sidebar -- the wildcards display literally, leaving no usable DB names in the sidebar.
A couple suggestions for how to fix this:
You could have a single spot in the code check the only_db list for wildcards, and if present, expand the list using "SHOW DATABASES LIKE ..." so that the only_db setting can always be assumed to be an array of actual DB names in the rest of the code. This would also allow you to remove some of the uses of LIKE in the db-name matching (which will improve speed due to SHOW DATABASES LIKE being faster than SELECT...FROM information_schema...LIKE).
You could decide to disallow wildcards in only_db and force the user to set the only_db config to a list of DB names. I'm using this idiom to work around the bug -- e.g. using this dir-listing idiom:
$prefix = 'expected_prefix_goes_here_'; $cfg['Servers'][$i]['only_db'] = preg_replace( '/@00([0-9a-f][0-9a-f])/e', 'chr(hexdec(\'\1\'))', preg_grep("/^$prefix/", scandir('/var/lib/mysql/')));
Yes, that has some short-cuts in it (e.g. no check for dir-ness for matches and limited substitution for escaped letters), but it works for my needs.