fixed character-set detection regex

Previous regex matched COLLATE value instead of CHARACTER SET. For example:

    CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */

Returned `utf8_bin` instead of `utf8` causing an unfortunate database refresh in my configuration. Fixed the regex by adding the optional presence of the COLLATE keyword.

Tested to make sure that it worked on both cases (w/ and w/o COLLATE).